From 8a63c6e2858f40aed3cd7e001c3f236a8af05416 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Mon, 19 Aug 2024 18:28:02 -0700 Subject: [PATCH] fix bug where discarding changes would not update the view --- dist/index.js | 6 +++++- src/View/Modals/taskSettingsModal.tsx | 2 +- src/ViewModel/Pages/taskViewModel.ts | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 42c6d504..03dbcb36 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1556,6 +1556,10 @@ close = () => { this.containingModel.closeTask(); }; + closeAndDiscard = () => { + this.close(); + this.loadTaskData(); + }; closeAndSave = () => { this.close(); this.save(); @@ -3329,7 +3333,7 @@ translations.chatPage.task.deleteTaskButton, "delete_forever", taskViewModel.deleteTask - ))), /* @__PURE__ */ createElement("div", { class: "flex-row width-100" }, /* @__PURE__ */ createElement("button", { class: "flex", "on:click": taskViewModel.close }, translations.general.closeButton), /* @__PURE__ */ createElement("button", { class: "flex primary", "on:click": taskViewModel.closeAndSave }, translations.general.saveButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "save"))))); + ))), /* @__PURE__ */ createElement("div", { class: "flex-row width-100" }, /* @__PURE__ */ createElement("button", { class: "flex", "on:click": taskViewModel.closeAndDiscard }, translations.general.closeButton), /* @__PURE__ */ createElement("button", { class: "flex primary", "on:click": taskViewModel.closeAndSave }, translations.general.saveButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "save"))))); } // src/View/Components/taskEntry.tsx diff --git a/src/View/Modals/taskSettingsModal.tsx b/src/View/Modals/taskSettingsModal.tsx index a549b1df..83a24a49 100644 --- a/src/View/Modals/taskSettingsModal.tsx +++ b/src/View/Modals/taskSettingsModal.tsx @@ -155,7 +155,7 @@ export function TaskSettingsModal(taskViewModel: TaskViewModel) {
-