From 26163c62da5b59217d2b40231b358326ddb63240 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sun, 18 May 2025 14:22:05 +0200 Subject: [PATCH] fix: Fixed background tab toast showing when not hiding the sidebar, b=(no-bug), c=compact-mode --- src/zen/compact-mode/ZenCompactMode.mjs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index c655f0053..b43aa7513 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -221,6 +221,13 @@ var gZenCompactModeManager = { return sidebarWidth; }, + get canHideSidebar() { + return ( + Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || + gZenVerticalTabsManager._hasSetSingleToolbar + ); + }, + animateCompactMode() { return new Promise((resolve) => { // Get the splitter width before hiding it (we need to hide it before animating on right) @@ -230,9 +237,7 @@ var gZenCompactModeManager = { .getElementById('zen-sidebar-splitter') .getBoundingClientRect().width; const isCompactMode = this.preference; - const canHideSidebar = - Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || - gZenVerticalTabsManager._hasSetSingleToolbar; + const canHideSidebar = this.canHideSidebar; let canAnimate = lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && !this.isSidebarPotentiallyOpen(); if (typeof this._wasInCompactMode !== 'undefined') { @@ -624,7 +629,8 @@ var gZenCompactModeManager = { !this.isSidebarPotentiallyOpen() && this._canShowBackgroundTabToast && !gZenGlanceManager._animating && - !this._nextTimeWillBeActive + !this._nextTimeWillBeActive && + this.canHideSidebar ) { gZenUIManager.showToast('zen-background-tab-opened-toast'); }