Skip to content

Commit ae8cff2

Browse files
committed
fix(app): renaming non-git projects shouldn't affect other projects
1 parent 5253565 commit ae8cff2

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/app/src/components/dialog-edit-project.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export function DialogEditProject(props: { project: LocalProject }) {
7575
const name = store.name.trim() === folderName() ? "" : store.name.trim()
7676
await globalSDK.client.project.update({
7777
projectID: props.project.id,
78+
directory: props.project.worktree,
7879
name,
7980
icon: { color: store.color, override: store.iconUrl },
8081
})

packages/app/src/context/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
296296
used.add(color)
297297
setColors(project.worktree, color)
298298
if (!project.id) continue
299-
void globalSdk.client.project.update({ projectID: project.id, icon: { color } })
299+
void globalSdk.client.project.update({ projectID: project.id, directory: project.worktree, icon: { color } })
300300
}
301301
})
302302

packages/app/src/pages/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ export default function Layout(props: ParentProps) {
979979
const current = displayName(project)
980980
if (next === current) return
981981
const name = next === getFilename(project.worktree) ? "" : next
982-
await globalSDK.client.project.update({ projectID: project.id, name })
982+
await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name })
983983
}
984984

985985
async function renameSession(session: Session, next: string) {

0 commit comments

Comments
 (0)