Skip to content

Commit 7d51ae1

Browse files
committed
fix: Fixed bookmarks being weird on private window, b=closes #8995, c=workspaces
1 parent 469604d commit 7d51ae1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
115115
document.documentElement.setAttribute('zen-private-window', 'true');
116116
}
117117

118+
this.popupOpenHandler = this._popupOpenHandler.bind(this);
119+
118120
window.addEventListener('resize', this.onWindowResize.bind(this));
119121
this.addPopupListeners();
120122

@@ -646,11 +648,22 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
646648
document.documentElement.removeAttribute('swipe-gesture');
647649
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
648650
this.updateTabsContainers();
651+
document.removeEventListener('popupshown', this.popupOpenHandler, { once: true });
649652
},
650653
true
651654
);
652655
}
653656

657+
_popupOpenHandler(event) {
658+
// If a popup is opened, we should stop the swipe gesture
659+
if (this._swipeState?.isGestureActive) {
660+
document.documentElement.removeAttribute('swipe-gesture');
661+
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
662+
this.updateTabsContainers();
663+
this._cancelSwipeAnimation();
664+
}
665+
}
666+
654667
_handleSwipeMayStart(event) {
655668
if (this.privateWindowOrDisabled || this._inChangingWorkspace) return;
656669
if (event.target.closest('#zen-sidebar-foot-buttons')) return;
@@ -669,6 +682,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
669682
if (!this.workspaceEnabled) return;
670683

671684
document.documentElement.setAttribute('swipe-gesture', 'true');
685+
document.addEventListener('popupshown', this.popupOpenHandler, { once: true });
672686

673687
event.preventDefault();
674688
event.stopPropagation();
@@ -842,6 +856,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
842856
}
843857

844858
async workspaceBookmarks() {
859+
if (this.privateWindowOrDisabled) {
860+
this._workspaceBookmarksCache = {
861+
bookmarks: [],
862+
lastChangeTimestamp: 0,
863+
};
864+
return this._workspaceBookmarksCache;
865+
}
866+
845867
if (this._workspaceBookmarksCache) {
846868
return this._workspaceBookmarksCache;
847869
}

0 commit comments

Comments
 (0)