Refactor ZenGlanceManager.mjs to simplify closing of glance by removing unnecessary animation option and handle quitting application when closing glance

This commit is contained in:
mr. M 2024-11-02 18:34:37 +01:00
parent 6d542ea79b
commit 9b4b399c59
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -173,6 +173,7 @@
this.lastCurrentTab = this.#currentTab;
this.overlay.classList.remove("zen-glance-overlay");
gBrowser._getSwitcher().setTabStateNoAction(this.lastCurrentTab, gBrowser.AsyncTabSwitcher.STATE_UNLOADED);
if (!onTabClose && gBrowser.selectedTab === this.lastCurrentTab) {
this._duringOpening = true;
@ -187,9 +188,9 @@
this.lastCurrentTab.removeAttribute("zen-glance-tab");
this.#currentTab.remove();
this.#currentBrowser.destroy();
this.#currentBrowser.closest(".browserSidebarContainer").remove();
gBrowser.tabContainer._invalidateCachedTabs();
gBrowser.removeTab(this.lastCurrentTab, { animate: false });
this.#currentTab = null;
this.#currentBrowser = null;