mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 20:09:57 +02:00
refactor(workspaces): remove unnecessary workspace propagation
Removes the unnecessary `_propagateWorkspaceData()` calls throughout the code, as the data propagation is handled by the `onSyncChange()` method after saving workspaces. This makes the code more concise and efficient.
This commit is contained in:
parent
ce4dd38b4b
commit
74309687ad
1 changed files with 4 additions and 11 deletions
|
@ -211,8 +211,6 @@ var ZenWorkspaces = {
|
||||||
delete this._lastSelectedWorkspaceTabs[windowID];
|
delete this._lastSelectedWorkspaceTabs[windowID];
|
||||||
json.workspaces = json.workspaces.filter((workspace) => workspace.uuid !== windowID);
|
json.workspaces = json.workspaces.filter((workspace) => workspace.uuid !== windowID);
|
||||||
this.unsafeSaveWorkspaces(json);
|
this.unsafeSaveWorkspaces(json);
|
||||||
this._propagateWorkspaceData();
|
|
||||||
this._updateWorkspacesChangeContextMenu();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
saveWorkspaces() {
|
saveWorkspaces() {
|
||||||
|
@ -228,6 +226,7 @@ var ZenWorkspaces = {
|
||||||
onSyncChange() {
|
onSyncChange() {
|
||||||
console.info("Syncing workspaces...");
|
console.info("Syncing workspaces...");
|
||||||
this._propagateWorkspaceData();
|
this._propagateWorkspaceData();
|
||||||
|
this._updateWorkspacesChangeContextMenu();
|
||||||
},
|
},
|
||||||
|
|
||||||
// Workspaces dialog UI management
|
// Workspaces dialog UI management
|
||||||
|
@ -273,7 +272,7 @@ var ZenWorkspaces = {
|
||||||
return workspace.name[0].toUpperCase();
|
return workspace.name[0].toUpperCase();
|
||||||
},
|
},
|
||||||
|
|
||||||
async _propagateWorkspaceData({
|
_propagateWorkspaceData({
|
||||||
ignoreStrip = false
|
ignoreStrip = false
|
||||||
} = {}) {
|
} = {}) {
|
||||||
let currentContainer = document.getElementById('PanelUI-zen-workspaces-current-info');
|
let currentContainer = document.getElementById('PanelUI-zen-workspaces-current-info');
|
||||||
|
@ -547,8 +546,6 @@ var ZenWorkspaces = {
|
||||||
icon?.removeAttribute('selected');
|
icon?.removeAttribute('selected');
|
||||||
this.createAndSaveWorkspace(workspaceName, false, icon?.label);
|
this.createAndSaveWorkspace(workspaceName, false, icon?.label);
|
||||||
document.getElementById('PanelUI-zen-workspaces').hidePopup(true);
|
document.getElementById('PanelUI-zen-workspaces').hidePopup(true);
|
||||||
this._updateWorkspacesButton();
|
|
||||||
this._propagateWorkspaceData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
saveWorkspaceFromEdit() {
|
saveWorkspaceFromEdit() {
|
||||||
|
@ -565,8 +562,6 @@ var ZenWorkspaces = {
|
||||||
workspaceData.name = workspaceName;
|
workspaceData.name = workspaceName;
|
||||||
workspaceData.icon = icon?.label;
|
workspaceData.icon = icon?.label;
|
||||||
this.saveWorkspace(workspaceData);
|
this.saveWorkspace(workspaceData);
|
||||||
this._updateWorkspacesButton();
|
|
||||||
this._propagateWorkspaceData();
|
|
||||||
this.closeWorkspacesSubView();
|
this.closeWorkspacesSubView();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -762,7 +757,6 @@ var ZenWorkspaces = {
|
||||||
let userContextId = parseInt(event.target.getAttribute('data-usercontextid'));
|
let userContextId = parseInt(event.target.getAttribute('data-usercontextid'));
|
||||||
workspace.containerTabId = userContextId;
|
workspace.containerTabId = userContextId;
|
||||||
this.saveWorkspace(workspace);
|
this.saveWorkspace(workspace);
|
||||||
this._propagateWorkspaceData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onContextMenuClose() {
|
onContextMenuClose() {
|
||||||
|
@ -781,7 +775,6 @@ var ZenWorkspaces = {
|
||||||
workspace.default = workspace.uuid === this._contextMenuId;
|
workspace.default = workspace.uuid === this._contextMenuId;
|
||||||
}
|
}
|
||||||
this.unsafeSaveWorkspaces(workspaces);
|
this.unsafeSaveWorkspaces(workspaces);
|
||||||
this._propagateWorkspaceData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
openWorkspace() {
|
openWorkspace() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue