Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix typing in editor title input

Ammar Ahmed8ab05c5a9866
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);