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