Allowed renamed pinned tabs to persist across sessions

This commit is contained in:
mr. M
2025-02-17 21:43:30 +01:00
parent 15a056b466
commit b8baca2100
3 changed files with 18 additions and 7 deletions

View File

@@ -147,8 +147,6 @@
return;
}
const workspaces = await ZenWorkspaces._workspaces();
const activeTab = gBrowser.selectedTab;
const pinnedTabsByUUID = new Map();
const pinsToCreate = new Set(pins.map((p) => p.uuid));
@@ -174,7 +172,21 @@
}
}
// Second pass: create new tabs for pins that don't have tabs
// Second pass: For every existing tab, update its label
// and set 'zen-has-static-label' attribute if it's been edited
for (let pin of pins) {
const tab = pinnedTabsByUUID.get(pin.uuid);
if (!tab) {
continue;
}
if (pin.title && pin.editedTitle) {
gBrowser._setTabLabel(tab, pin.title);
tab.setAttribute('zen-has-static-label', 'true');
}
}
// Third pass: create new tabs for pins that don't have tabs
for (let pin of pins) {
if (!pinsToCreate.has(pin.uuid)) {
continue; // Skip pins that already have tabs