fix: Fixed 'restore previous tabs' ignored when only pinned sync is enabled, b=closes #12297, c=tabs

This commit is contained in:
mr. m
2026-02-08 10:35:05 +01:00
parent 049c3c6f54
commit 12f0c455d1
2 changed files with 7 additions and 2 deletions

View File

@@ -568,7 +568,10 @@ export class nsZenSessionManager {
// as they should be the same as the ones in the sidebar.
if (lazy.gSyncOnlyPinnedTabs) {
let pinnedTabs = (sidebar.tabs || []).filter((tab) => tab.pinned);
let unpinedWindowTabs = (aWindowData.tabs || []).filter((tab) => !tab.pinned);
let unpinedWindowTabs = [];
if (!this.#shouldRestoreOnlyPinned) {
unpinedWindowTabs = (aWindowData.tabs || []).filter((tab) => !tab.pinned);
}
aWindowData.tabs = [...pinnedTabs, ...unpinedWindowTabs];
// We restore ALL the split view data in the sidebar, if the group doesn't exist in the window,

View File

@@ -532,7 +532,9 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
const isEssential = contextTab.getAttribute("zen-essential");
const zenAddEssential = document.getElementById("context_zen-add-essential");
const zenResetPinnedTab = document.getElementById("context_zen-reset-pinned-tab");
const zenReplacePinnedUrl = document.getElementById("context_zen-replace-pinned-url-with-current");
const zenReplacePinnedUrl = document.getElementById(
"context_zen-replace-pinned-url-with-current"
);
[zenResetPinnedTab, zenReplacePinnedUrl].forEach((element) => {
if (element) {
element.hidden = !isVisible;