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.
This commit is contained in:
drelich
2026-03-26 09:23:36 +01:00
parent 8bbd5f9262
commit 0a5dba2a98

View File

@@ -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;