Skip to content

Commit e8fa69f

Browse files
committed
fix: prevent saving when there are no unsaved changes in EditorContainer
1 parent 7cc6c1f commit e8fa69f

File tree

1 file changed

+4
-2
lines changed
  • src/editors/containers/EditorContainer

1 file changed

+4
-2
lines changed

src/editors/containers/EditorContainer/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ const EditorContainer: React.FC<Props> = ({
7878
});
7979

8080
const onSave = () => {
81-
setSaved(true);
82-
handleSave();
81+
if (isDirty()) {
82+
setSaved(true);
83+
handleSave();
84+
}
8385
};
8486
// Stops user from navigating away if they have unsaved changes.
8587
usePromptIfDirty(() => {

0 commit comments

Comments
 (0)