web: mark a note unsaved only once an edit is dropped

This commit is contained in:
Ammar Ahmed
2026-08-25 23:04:22 +05:00
parent 5959364de5
commit 09ba20e009

View File

@@ -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