Skip to content

Commit

Permalink
separate logic from reactivity condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alpetric committed Jan 10, 2025
1 parent 60523fa commit 1af9e6f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1af9e6f

Please sign in to comment.