Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

Commit 6dd9334

Browse files
feat: Prompt when deleting workspace
1 parent 4895f2f commit 6dd9334

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

browser/base/content/browser-workspaces.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,23 @@ export const gWorkspaces = {
552552
async deleteWorkspace(workspaceId) {
553553
let windowId = await this.getCurrentWindowId();
554554
let currentWorkspaceId = await this.getCurrentWorkspaceId();
555-
await WorkspacesService.deleteWorkspace(workspaceId, windowId);
556-
this.removeWorkspaceTabs(workspaceId);
557-
if (workspaceId == currentWorkspaceId) {
558-
await this.changeWorkspace(
559-
await WorkspacesWindowIdUtils.getDefaultWorkspaceId(windowId),
560-
0
561-
);
555+
const workspace = await this.getWorkspaceById(workspaceId);
556+
const result = Services.prompt.confirm(
557+
window,
558+
this.l10n.formatValueSync("delete-workspace-prompt-title"),
559+
this.l10n.formatValueSync("delete-workspace-prompt-text", { name: workspace.name }),
560+
);
561+
if (result) {
562+
await WorkspacesService.deleteWorkspace(workspaceId, windowId);
563+
this.removeWorkspaceTabs(workspaceId);
564+
if (workspaceId == currentWorkspaceId) {
565+
await this.changeWorkspace(
566+
await WorkspacesWindowIdUtils.getDefaultWorkspaceId(windowId),
567+
0
568+
);
569+
}
570+
this.rebuildWorkspacesToolbar();
562571
}
563-
this.rebuildWorkspacesToolbar();
564572
},
565573

566574
async renameWorkspace(workspaceId, newName) {

0 commit comments

Comments
 (0)