From 7acd1a7e5134fde1187f63b89020f9cae184b696 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 7 Apr 2024 15:03:18 +0200 Subject: [PATCH] fix(project): remove child projects from state when deleting a project --- frontend/src/stores/projects.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/stores/projects.ts b/frontend/src/stores/projects.ts index e6b436e6a..7c9bbbe1c 100644 --- a/frontend/src/stores/projects.ts +++ b/frontend/src/stores/projects.ts @@ -106,6 +106,12 @@ export const useProjectStore = defineStore('project', () => { } function removeProjectById(project: IProject) { + + // Remove child projects from state as well + projectsArray.value + .filter(p => p.parentProjectId === project.id) + .forEach(p => removeProjectById(p)) + remove(project) delete projects.value[project.id] }