Add project closing action menu

This commit is contained in:
Federico Jaramillo Martinez
2026-05-08 15:03:38 +02:00
parent 1bbad2e89f
commit 99f434a259
11 changed files with 126 additions and 22 deletions
+8
View File
@@ -61,6 +61,14 @@ export class ProjectStore {
return (await this.list()).find((p) => p.id === id);
}
async remove(id: string): Promise<boolean> {
const data = await this.read();
const projects = data.projects.filter((p) => p.id !== id);
if (projects.length === data.projects.length) return false;
await this.write({ projects });
return true;
}
private async read(): Promise<ProjectFile> {
try {
const value: unknown = JSON.parse(await readFile(this.filePath, "utf8"));