Merge pull request #52 from kristijanribaric/fix/workspaces-open-external-links-in-default-container

Fix: Open external links in workspace's default container
This commit is contained in:
mr. m 🤙 2024-10-13 23:48:21 +02:00 committed by GitHub
commit 232cb69ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -874,10 +874,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
});
}
getContextIdIfNeeded(userContextId) {
getContextIdIfNeeded(userContextId, fromExternal, allowInheritPrincipal) {
if(!this.workspaceEnabled) {
return [userContextId, false];
}
const activeWorkspace = this.getActiveWorkspaceFromCache();
const activeWorkspaceUserContextId = activeWorkspace?.containerTabId;
if ((typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) || !this.workspaceEnabled) {
if((fromExternal || allowInheritPrincipal === false) && !!activeWorkspaceUserContextId) {
return [activeWorkspaceUserContextId, true];
}
if (typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) {
return [userContextId, false];
}
return [activeWorkspaceUserContextId, true];