From 8d6fd371c5eb97114a98bae8a7715136277d1c24 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Fri, 10 Jan 2025 10:25:27 -0500 Subject: [PATCH 1/2] fix workspace color picker issue --- .../lib/components/settings/ChangeWorkspaceColor.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte index dd325f1354d41..d0e39998a28fd 100644 --- a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte +++ b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte @@ -8,11 +8,12 @@ import Toggle from '$lib/components/Toggle.svelte' let colorEnabled = false + let workspaceColor = $usersWorkspaceStore?.workspaces.find(w => w.id === $workspaceStore)?.color + export let open = false - $: workspaceColor = $usersWorkspaceStore?.workspaces.find(w => w.id === $workspaceStore)?.color - $: colorEnabled = !!workspaceColor - $: colorEnabled && !workspaceColor && generateRandomColor() + $: workspaceColor + $: if (colorEnabled && !workspaceColor) generateRandomColor() function generateRandomColor() { const randomColor = @@ -34,6 +35,7 @@ }) usersWorkspaceStore.set(await WorkspaceService.listUserWorkspaces()) + workspaceColor = colorToSave sendUserToast(`Workspace color updated.`) } From ac58c038c54893ffe133f65aef474cd85333e7ce Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Fri, 10 Jan 2025 10:41:45 -0500 Subject: [PATCH 2/2] removing useless reactive statement --- frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte index d0e39998a28fd..a99862d306178 100644 --- a/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte +++ b/frontend/src/lib/components/settings/ChangeWorkspaceColor.svelte @@ -12,7 +12,6 @@ export let open = false - $: workspaceColor $: if (colorEnabled && !workspaceColor) generateRandomColor() function generateRandomColor() {