fix(app): renaming non-git projects shouldn't affect other projects
This commit is contained in:
@@ -75,6 +75,7 @@ export function DialogEditProject(props: { project: LocalProject }) {
|
|||||||
const name = store.name.trim() === folderName() ? "" : store.name.trim()
|
const name = store.name.trim() === folderName() ? "" : store.name.trim()
|
||||||
await globalSDK.client.project.update({
|
await globalSDK.client.project.update({
|
||||||
projectID: props.project.id,
|
projectID: props.project.id,
|
||||||
|
directory: props.project.worktree,
|
||||||
name,
|
name,
|
||||||
icon: { color: store.color, override: store.iconUrl },
|
icon: { color: store.color, override: store.iconUrl },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
|
|||||||
used.add(color)
|
used.add(color)
|
||||||
setColors(project.worktree, color)
|
setColors(project.worktree, color)
|
||||||
if (!project.id) continue
|
if (!project.id) continue
|
||||||
void globalSdk.client.project.update({ projectID: project.id, icon: { color } })
|
void globalSdk.client.project.update({ projectID: project.id, directory: project.worktree, icon: { color } })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -979,7 +979,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
const current = displayName(project)
|
const current = displayName(project)
|
||||||
if (next === current) return
|
if (next === current) return
|
||||||
const name = next === getFilename(project.worktree) ? "" : next
|
const name = next === getFilename(project.worktree) ? "" : next
|
||||||
await globalSDK.client.project.update({ projectID: project.id, name })
|
await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function renameSession(session: Session, next: string) {
|
async function renameSession(session: Session, next: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user