From 87afc64f16c82bd4690c1e825c5911c81d266f2e Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 18 Nov 2025 01:21:26 +0200 Subject: [PATCH] client/note color picker menu item: fix current selection --- apps/client/src/menus/custom-items/ColorPickerMenuItem.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/client/src/menus/custom-items/ColorPickerMenuItem.tsx b/apps/client/src/menus/custom-items/ColorPickerMenuItem.tsx index b9e6d876a..030a853e4 100644 --- a/apps/client/src/menus/custom-items/ColorPickerMenuItem.tsx +++ b/apps/client/src/menus/custom-items/ColorPickerMenuItem.tsx @@ -17,13 +17,11 @@ export default function ColorPickerMenuItem(props: ColorPickerMenuItemProps) { const [note, setNote] = useState(null); const [currentColor, setCurrentColor] = useState(null); - useEffect(() => { const retrieveNote = async (noteId: string) => { const result = await froca.getNote(noteId, true); if (result) { setNote(result); - setCurrentColor(result.getLabel("color")?.value ?? ""); } } @@ -34,6 +32,10 @@ export default function ColorPickerMenuItem(props: ColorPickerMenuItemProps) { } }, []); + useEffect(() => { + setCurrentColor(note?.getLabel("color")?.value ?? ""); + }, [note]); + const onColorCellClicked = (color: string) => { if (note) { attributes.setLabel(note.noteId, "color", color);