fix(notes): sync pinned note state in sidebar and editor menu (#25918)

This commit is contained in:
G30 authored and GitHub committed 2026-06-17 00:42:20 +02:00
1 parent 25090dbf17
commit 2b9b956dad
1 file changed
+5 -1
+5 -1
View File
@@ -219,6 +219,10 @@
}).catch((e) => { }).catch((e) => {
toast.error(`${e}`); toast.error(`${e}`);
}); });
if (res) {
pinnedNotes.set(await getPinnedNoteList(localStorage.token).catch(() => []));
}
}, 200); }, 200);
}; };
@@ -1092,7 +1096,7 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
onDelete={() => { onDelete={() => {
showDeleteConfirm = true; showDeleteConfirm = true;
}} }}
isPinned={note.is_pinned ?? false} isPinned={$pinnedNotes.some((n) => n.id === note.id)}
onPin={async () => { onPin={async () => {
await toggleNotePinnedStatusById(localStorage.token, note.id); await toggleNotePinnedStatusById(localStorage.token, note.id);
note = await getNoteById(localStorage.token, note.id); note = await getNoteById(localStorage.token, note.id);