fix: reopen preserved coding projects when selecting their folder
This commit is contained in:
@@ -268,6 +268,22 @@ export class CodingProjectService {
|
||||
}
|
||||
try {
|
||||
return await this.transitionActiveProject(async () => {
|
||||
// Removing a project only forgets the catalog entry. Selecting its folder
|
||||
// again must reuse the project-owned configuration, not overwrite it.
|
||||
if (selectedPath && input.identity.kind === 'create') {
|
||||
const existing = await readCodingProjectConfigV2(projectPath);
|
||||
if (existing.status === 'invalid') {
|
||||
throw new CodingProjectServiceError(
|
||||
409,
|
||||
'CODING_PROJECT_CONFIG_INVALID',
|
||||
'Coding project configuration is unavailable',
|
||||
);
|
||||
}
|
||||
if (existing.status === 'valid') {
|
||||
const project = await this.store.openFolder(projectPath);
|
||||
return { project, value: await this.getConfig(project.id) };
|
||||
}
|
||||
}
|
||||
const { project, config } = await createLocalCodingProject({
|
||||
projectPath,
|
||||
projectId,
|
||||
|
||||
Reference in New Issue
Block a user