Merge pull request #2656 from kristijanribaric/fix/pinned-tab-manager-make-sure-contextual-id-is-applied-correctly

Fix: Parse user context ID correctly when pinning tabs
This commit is contained in:
mr. m 🤙
2024-11-05 09:08:35 +02:00
committed by GitHub

View File

@@ -225,10 +225,12 @@
return;
}
const userContextId = tab.getAttribute("usercontextid");
pin.title = tab.label || browser.contentTitle;
pin.url = browser.currentURI.spec;
pin.workspaceUuid = tab.getAttribute("zen-workspace-id");
pin.userContextId = tab.getAttribute("userContextId");
pin.userContextId = userContextId ? parseInt(userContextId, 10) : 0;
await ZenPinnedTabsStorage.savePin(pin);
await this._refreshPinnedTabs();
@@ -243,12 +245,13 @@
const browser = tab.linkedBrowser;
const uuid = gZenUIManager.generateUuidv4();
const userContextId = tab.getAttribute("usercontextid");
await ZenPinnedTabsStorage.savePin({
uuid,
title: tab.label || browser.contentTitle,
url: browser.currentURI.spec,
containerTabId: tab.getAttribute("userContextId"),
containerTabId: userContextId ? parseInt(userContextId, 10) : 0,
workspaceUuid: tab.getAttribute("zen-workspace-id"),
isEssential: tab.getAttribute("zen-essential") === "true"
});