fix: added fallback for state removal (#2268)

This commit is contained in:
Vamsi Krishna
2025-01-29 13:16:21 +05:30
committed by GitHub
parent bf6f6530b3
commit 836f2155e6

View File

@@ -282,11 +282,12 @@ export class WorkspaceProjectStatesStore implements IWorkspaceProjectStatesStore
*/
removeProjectState = async (workspaceSlug: string, projectStateId: string): Promise<void | undefined> => {
// if (!this.isSettingsEnabled) return undefined;
const currentProjectState = this.projectStates[projectStateId];
try {
unset(this.projectStates, projectStateId);
await projectStateService.removeProjectState(workspaceSlug, projectStateId);
} catch (error) {
set(this.projectStates, projectStateId, currentProjectState);
console.error("project states --> removeProjectState", error);
throw error;
}