From 701522a0600cfa542469540ed764630c0ba1a732 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 30 Nov 2025 07:58:37 +0100 Subject: [PATCH] fix: do not close editor if save failed Closes #5591 --- frontend/src/views/files/Editor.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue index 0913ea98..58f0d524 100644 --- a/frontend/src/views/files/Editor.vue +++ b/frontend/src/views/files/Editor.vue @@ -186,7 +186,7 @@ const handlePageChange = (event: BeforeUnloadEvent) => { } }; -const save = async () => { +const save = async (throwError?: boolean) => { const button = "save"; buttons.loading("save"); @@ -197,6 +197,7 @@ const save = async () => { } catch (e: any) { buttons.done(button); $showError(e); + if (throwError) throw e; } }; @@ -223,8 +224,10 @@ const close = () => { finishClose(); }, saveAction: async () => { - await save(); - finishClose(); + try { + await save(true); + finishClose(); + } catch {} }, }); return;