diff --git a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte index bf5a85120ec50..1b79adad28030 100644 --- a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte +++ b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte @@ -14,9 +14,11 @@ export let open = false - $: if ($usersWorkspaceStore && $workspaceStore !== lastWorkspace) { + $: $usersWorkspaceStore && $workspaceStore !== lastWorkspace && onWorkspaceChange() + + function onWorkspaceChange() { lastWorkspace = $workspaceStore - savedWorkspaceColor = $usersWorkspaceStore.workspaces.find( + savedWorkspaceColor = $usersWorkspaceStore?.workspaces.find( (w) => w.id === $workspaceStore )?.color workspaceColor = savedWorkspaceColor