Skip to content

Commit

Permalink
fix: editor discard prompt (#2990)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouizoui78 committed Feb 9, 2024
1 parent d49c3df commit 34a0817
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/views/files/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,15 @@ export default {
try {
await api.put(this.$route.path, this.editor.getValue());
this.editor.session.getUndoManager().markClean();
buttons.success(button);
} catch (e) {
buttons.done(button);
this.$showError(e);
}
},
close() {
const originalContent = this.req.content;
const currentContent = this.editor.getValue();
if (originalContent !== currentContent) {
if (!this.editor.session.getUndoManager().isClean()) {
this.$store.commit("showHover", "discardEditorChanges");
return;
}
Expand Down

0 comments on commit 34a0817

Please sign in to comment.