diff options
Diffstat (limited to 'packages/app/src/context/layout.tsx')
| -rw-r--r-- | packages/app/src/context/layout.tsx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/app/src/context/layout.tsx b/packages/app/src/context/layout.tsx index 7a3556290..3c544b069 100644 --- a/packages/app/src/context/layout.tsx +++ b/packages/app/src/context/layout.tsx @@ -222,7 +222,8 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( const metadata = projectID ? globalSync.data.project.find((x) => x.id === projectID) : globalSync.data.project.find((x) => x.worktree === project.worktree) - return { + + const base = { ...(metadata ?? {}), ...project, icon: { @@ -231,6 +232,20 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( color: metadata?.icon?.color, }, } + + if (projectID !== "global") return base + + const local = childStore.projectMeta + return { + ...base, + name: local?.name, + commands: local?.commands, + icon: { + url: base.icon?.url, + override: local?.icon?.override, + color: local?.icon?.color, + }, + } } const roots = createMemo(() => { @@ -296,6 +311,10 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext( used.add(color) setColors(project.worktree, color) if (!project.id) continue + if (project.id === "global") { + globalSync.project.meta(project.worktree, { icon: { color } }) + continue + } void globalSdk.client.project.update({ projectID: project.id, directory: project.worktree, icon: { color } }) } }) |
