Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/apps/main/core/common/workspaces/workspacesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,20 @@ export class WorkspacesService implements WorkspacesDataManagerBase {

deleteWorkspace(workspaceID: TWorkspaceID): void {
if (workspacesDataStore.data.size === 1) return;
this.tabManagerCtx.removeTabByWorkspaceId(workspaceID);
setWorkspacesDataStore(
"order",
(prev) => prev.filter((v) => v !== workspaceID),
const workspace = this.getRawWorkspace(workspaceID);
const result = Services.prompt.confirm(
window,
i18next.t('workspaces.modal.deleteTitle'),
i18next.t('workspaces.modal.deleteText', { name: workspace.name }),
);
this.dataManagerCtx.deleteWorkspace(workspaceID);
if (result) {
this.tabManagerCtx.removeTabByWorkspaceId(workspaceID);
setWorkspacesDataStore(
"order",
(prev) => prev.filter((v) => v !== workspaceID),
);
this.dataManagerCtx.deleteWorkspace(workspaceID);
}
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/apps/main/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"icon": "Icon",
"edit-title": "Edit Workspace",
"save": "Save Changes",
"cancel": "Cancel"
"cancel": "Cancel",
"deleteTitle": "Delete workspace",
"deleteText": "Please confirm to delete workspace: {{name}}"
},
"icons": {
"article": "Article",
Expand Down Expand Up @@ -231,4 +233,4 @@
"set_pref_description": "Please set the editor path",
"please_enter_filename": "Please enter a filename"
}
}
}