From 0a5dba2a98b9f770d17f8d31cba2733b68618a1b Mon Sep 17 00:00:00 2001 From: drelich Date: Thu, 26 Mar 2026 09:23:36 +0100 Subject: [PATCH] Fix favorite star not showing in editor toolbar after sync Added note.favorite to useEffect dependencies so localFavorite state updates when favorite status changes via background sync from mobile. --- src/components/NoteEditor.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/NoteEditor.tsx b/src/components/NoteEditor.tsx index 467910b..f50279c 100644 --- a/src/components/NoteEditor.tsx +++ b/src/components/NoteEditor.tsx @@ -167,7 +167,11 @@ export function NoteEditor({ note, onUpdateNote, onToggleFavorite, onUnsavedChan else if (!note || previousNoteIdRef.current === null) { loadNewNote(); } - }, [note?.id, note?.content, note?.modified]); + // Favorite status changed (e.g., from sync) + else if (note && note.favorite !== localFavorite) { + setLocalFavorite(note.favorite); + } + }, [note?.id, note?.content, note?.modified, note?.favorite]); const handleSave = () => { if (!note || !hasUnsavedChanges) return;