mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:49:59 +02:00
Add lazy pref getter for zen.workspaces.force-container-workspace
This commit is contained in:
parent
b66af853f2
commit
74bd43f9c9
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
true,
|
||||
this._expandWorkspacesStrip.bind(this)
|
||||
);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
'shouldForceContainerTabsToWorkspace',
|
||||
'zen.workspaces.force-container-workspace',
|
||||
true
|
||||
);
|
||||
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
|
||||
await ZenWorkspacesStorage.init();
|
||||
if(!Weave.Service.engineManager.get("workspaces")) {
|
||||
|
@ -879,7 +885,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
return [userContextId, false];
|
||||
}
|
||||
|
||||
if(Services.prefs.getBoolPref('zen.workspaces.force-container-workspace', false) && typeof userContextId !== 'undefined' && this._workspaceCache?.workspaces) {
|
||||
if(this.shouldForceContainerTabsToWorkspace && typeof userContextId !== 'undefined' && this._workspaceCache?.workspaces) {
|
||||
const workspace = this._workspaceCache.workspaces.find((workspace) => workspace.containerTabId === userContextId);
|
||||
if(workspace && workspace.uuid !== this.getActiveWorkspaceFromCache().uuid) {
|
||||
this.changeWorkspace(workspace).then(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue