mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 19:29:58 +02:00
fix(workspaces): Use active workspace context ID for external calls
This commit modifies the `getContextIdIfNeeded` method to automatically use the active workspace context ID for external calls. Previously, external calls would use the provided `userContextId` if it was different from the active workspace context ID. Now, if `fromExternal` is true and there's an active workspace, the method will return the active workspace context ID, ensuring consistency with the active workspace.
This commit is contained in:
parent
1bc2cf53c8
commit
893ebcd0f7
1 changed files with 11 additions and 2 deletions
|
@ -874,10 +874,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getContextIdIfNeeded(userContextId) {
|
getContextIdIfNeeded(userContextId, fromExternal) {
|
||||||
|
if(!this.workspaceEnabled) {
|
||||||
|
return [userContextId, false];
|
||||||
|
}
|
||||||
|
|
||||||
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
||||||
const activeWorkspaceUserContextId = activeWorkspace?.containerTabId;
|
const activeWorkspaceUserContextId = activeWorkspace?.containerTabId;
|
||||||
if ((typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) || !this.workspaceEnabled) {
|
|
||||||
|
if(fromExternal && !!activeWorkspaceUserContextId) {
|
||||||
|
return [activeWorkspaceUserContextId, true];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) {
|
||||||
return [userContextId, false];
|
return [userContextId, false];
|
||||||
}
|
}
|
||||||
return [activeWorkspaceUserContextId, true];
|
return [activeWorkspaceUserContextId, true];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue