Skip to content

Commit aa07f38

Browse files
Brendonovichsnatvb
andauthored
fix(app): preserve per-workspace icon override from localStorage (#24738)
Co-authored-by: Andrew Avsenin <snatvb@ya.ru>
1 parent 9d1f17d commit aa07f38

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/app/src/context/layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,14 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
391391
? globalSync.data.project.find((x) => x.id === projectID)
392392
: globalSync.data.project.find((x) => x.worktree === project.worktree)
393393

394-
return { ...metadata, ...project }
394+
// Preserve local icon override from per-workspace localStorage cache (childStore.icon).
395+
// Without this, different subdirectories of the same git repo would share the same
396+
// icon from the database instead of using their individual overrides.
397+
const base = { ...metadata, ...project }
398+
if (childStore.icon) {
399+
return { ...base, icon: { ...base.icon, override: childStore.icon } }
400+
}
401+
return base
395402
}
396403

397404
const roots = createMemo(() => {

0 commit comments

Comments
 (0)