From 09ba20e00952788ccf44dc34b26af207412be579 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 25 Aug 2026 23:04:22 +0500 Subject: [PATCH] web: mark a note unsaved only once an edit is dropped --- apps/web/src/components/editor/tiptap.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx index b61e1bf0e..7eeafd7c4 100644 --- a/apps/web/src/components/editor/tiptap.tsx +++ b/apps/web/src/components/editor/tiptap.tsx @@ -367,7 +367,10 @@ function TipTap(props: TipTapProps) { if (ignoreEdit || preventSave || !editor.isEditable || !onChange) return; - if (!autoSave.current) return; + if (!autoSave.current) { + onAutoSaveDisabled(); + return; + } onChange( () => @@ -571,9 +574,6 @@ function TipTap(props: TipTapProps) { useEffect(() => { const update = (totalWords?: number) => { autoSave.current = !totalWords || totalWords < MAX_AUTO_SAVEABLE_WORDS; - if (!autoSave.current) { - onAutoSaveDisabled(); - } }; // The editor's statistics are set from `onCreate`, which runs before this