Skip to content

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

mobile: fix $headline$ format title not updating in realtime

Ammar Ahmedc9cf15e5193a
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
index 8fa07ddb6..5741448be 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
@@ -353,12 +353,12 @@ export const useEditor = (
clearTimeout(saveTimer);
+ if (id) {
+ currentNotes.current[id] = await db.notes?.note(id);
+ }
+
if (!note && id) {
editorSessionHistory.newSession(id);
- if (id) {
- currentNotes.current[id] = await db.notes?.note(id);
- }
-
useTabStore.getState().updateTab(tabId, {
session: {
noteId: id
@@ -374,16 +374,14 @@ export const useEditor = (
} else {
state.current?.onNoteCreated && state.current.onNoteCreated(id);
}
-
- if (!noteData.title) {
- postMessage(
- NativeEvents.title,
- currentNotes.current[id]?.title,
- tabId
- );
- }
}
+ postMessage(
+ NativeEvents.title,
+ currentNotes.current[id]?.title,
+ tabId
+ );
+
if (Notifications.isNotePinned(id as string)) {
Notifications.pinNote(id as string);
}