fix: editor discard prompt doesn't save nor discard

Co-authored-by: Ryan Miller <ryan.miller@infinitetactics.com>
This commit is contained in:
RyanandRyan Miller authored and GitHub committed 2025-10-17 16:45:36 +02:00
1 parent d0039afbb7
commit a397e7305d
2 files changed
+16 -10

No files matched your search

+14 -2
View File
@@ -216,12 +216,24 @@ const decreaseFontSize = () => {
const close = () => {
if (!editor.value?.session.getUndoManager().isClean()) {
layoutStore.showHover("discardEditorChanges");
layoutStore.showHover({
prompt: "discardEditorChanges",
confirm: (event: Event) => {
event.preventDefault();
finishClose();
},
saveAction: async () => {
await save();
finishClose();
},
});
return;
}
finishClose();
};
const finishClose = () => {
fileStore.updateRequest(null);
const uri = url.removeLastDir(route.path) + "/";
router.push({ path: uri });
};