From 3e82ee337c5d8150ad88cfcba97dccda06209a68 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Mon, 28 Apr 2025 10:33:58 +0500 Subject: [PATCH] mobile: fix typing in editor title input --- .../app/screens/editor/tiptap/use-editor.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts index 56b67067f..0c475e7da 100644 --- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts +++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts @@ -352,7 +352,7 @@ export const useEditor = ( DatabaseLogger.log(`Note saved: ${id}...`); clearTimeout(saveTimer); - + const oldNote = currentNotes.current[id]; if (id) { currentNotes.current[id] = await db.notes?.note(id); } @@ -376,11 +376,16 @@ export const useEditor = ( } } - postMessage( - NativeEvents.title, - currentNotes.current[id]?.title, - tabId - ); + if ( + oldNote?.title !== currentNotes.current[id]?.title && + !noteData.title + ) { + postMessage( + NativeEvents.title, + currentNotes.current[id]?.title, + tabId + ); + } if (Notifications.isNotePinned(id as string)) { Notifications.pinNote(id as string);