Going back to the input from the preview no longer empties the textfield, allowing for easier edits before importing

This commit is contained in:
CPTN Cosmo 2026-01-24 12:02:46 +01:00
parent b6a1af9926
commit 3e9bc42ca4
No known key found for this signature in database
4 changed files with 19 additions and 6 deletions

View file

@ -8,6 +8,7 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
this.step = "input";
this.parsedData = null;
this.parsedDataType = null;
this.inputText = "";
}
static DEFAULT_OPTIONS = {
@ -45,7 +46,8 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
types: {
adversary: "Adversary",
environment: "Environment"
}
},
inputText: this.inputText
};
}
@ -75,6 +77,9 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
const text = form.querySelector("textarea[name='text']").value;
const type = form.querySelector("select[name='type']").value;
// Store input text
this.inputText = text;
if (!text) {
ui.notifications.warn("Please enter text to import.");
return;