Skip to content

Commit

Permalink
Merge pull request #2656 from kristijanribaric/fix/pinned-tab-manager…
Browse files Browse the repository at this point in the history
…-make-sure-contextual-id-is-applied-correctly

Fix: Parse user context ID correctly when pinning tabs
  • Loading branch information
mauro-balades authored Nov 5, 2024
2 parents 44e5a98 + 7ae2d6d commit bd3c8d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/browser/base/zen-components/ZenPinnedTabManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"
});
Expand Down

0 comments on commit bd3c8d1

Please sign in to comment.