From 02c60d14c7653c8ba266e68ea34154943ef3b388 Mon Sep 17 00:00:00 2001 From: kashaf-ansari-dev Date: Wed, 29 Jul 2026 10:31:36 +0500 Subject: [PATCH] editor: skip ignoreEdit updates before scheduling save Signed-off-by: kashaf-ansari-dev --- packages/editor-mobile/src/hooks/useEditorController.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/editor-mobile/src/hooks/useEditorController.ts b/packages/editor-mobile/src/hooks/useEditorController.ts index 4d7f8008b..e5b9a2ceb 100644 --- a/packages/editor-mobile/src/hooks/useEditorController.ts +++ b/packages/editor-mobile/src/hooks/useEditorController.ts @@ -216,8 +216,7 @@ export function useEditorController({ return; } - const timerPending = !!timers.current.change; - if (ignoreEdit && timerPending) { + if (ignoreEdit) { logger("info", "Ignoring ignoreEdit update, a save is already pending"); return; } @@ -227,8 +226,8 @@ export function useEditorController({ const noteId = tabRef.current.session?.noteId; post(EditorEvents.contentchange, undefined, tabId, noteId); if (!editor) return; - if (timerPending) { - clearTimeout(timers.current?.change as any); + if (typeof timers.current.change === "number") { + clearTimeout(timers.current?.change); } timers.current.change = setTimeout(async () => { @@ -246,7 +245,6 @@ export function useEditorController({ const editedAt = Date.now(); htmlContentRef.current = editor.getHTML(); - timers.current.change = null; const params = [ {