@@ -1215,10 +1215,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
1215
1215
1216
1216
async removeWorkspace ( windowID ) {
1217
1217
let workspacesData = await this . _workspaces ( ) ;
1218
- this . _deleteAllTabsInWorkspace ( windowID ) ;
1219
1218
await this . changeWorkspace (
1220
1219
workspacesData . workspaces . find ( ( workspace ) => workspace . uuid !== windowID )
1221
1220
) ;
1221
+ this . _deleteAllTabsInWorkspace ( windowID ) ;
1222
1222
delete this . _lastSelectedWorkspaceTabs [ windowID ] ;
1223
1223
await ZenWorkspacesStorage . removeWorkspace ( windowID ) ;
1224
1224
// Remove the workspace from the cache
@@ -1227,12 +1227,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
1227
1227
) ;
1228
1228
await this . _propagateWorkspaceData ( ) ;
1229
1229
await this . _updateWorkspacesChangeContextMenu ( ) ;
1230
+ this . workspaceElement ( windowID ) ?. remove ( ) ;
1230
1231
this . onWindowResize ( ) ;
1231
- for ( let container of document . querySelectorAll (
1232
- `.zen-workspace-tabs-section[zen-workspace-id="${ windowID } "]`
1233
- ) ) {
1234
- container . remove ( ) ;
1235
- }
1236
1232
this . registerPinnedResizeObserver ( ) ;
1237
1233
}
1238
1234
@@ -1379,7 +1375,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
1379
1375
gBrowser . removeTabs (
1380
1376
Array . from ( this . allStoredTabs ) . filter (
1381
1377
( tab ) =>
1382
- tab . getAttribute ( 'zen-workspace-id' ) === workspaceID && ! tab . hasAttribute ( 'zen-empty-tab' )
1378
+ tab . getAttribute ( 'zen-workspace-id' ) === workspaceID &&
1379
+ ! tab . hasAttribute ( 'zen-empty-tab' ) &&
1380
+ ! tab . hasAttribute ( 'zen-essential' )
1383
1381
) ,
1384
1382
{
1385
1383
animate : false ,
@@ -2395,12 +2393,13 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
2395
2393
}
2396
2394
2397
2395
async contextDeleteWorkspace ( ) {
2396
+ const workspaceId = this . #contextMenuData?. workspaceId || this . activeWorkspace ;
2398
2397
const [ title , body ] = await document . l10n . formatValues ( [
2399
2398
{ id : 'zen-workspaces-delete-workspace-title' } ,
2400
2399
{ id : 'zen-workspaces-delete-workspace-body' } ,
2401
2400
] ) ;
2402
2401
if ( Services . prompt . confirm ( null , title , body ) ) {
2403
- await this . removeWorkspace ( this . #contextMenuData ?. workspaceId || this . activeWorkspace ) ;
2402
+ await this . removeWorkspace ( workspaceId ) ;
2404
2403
}
2405
2404
}
2406
2405
0 commit comments