mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-17 07:16:16 +00:00
fix: skip permitUnload when fully opening glance
This commit is contained in:
@@ -234,14 +234,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
closeGlance({ noAnimation = false, onTabClose = false, setNewID = null, isDifferent = false, hasFocused = false } = {}) {
|
closeGlance({ noAnimation = false, onTabClose = false, setNewID = null, isDifferent = false, hasFocused = false, skipPermitUnload = false } = {}) {
|
||||||
if (this._animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) {
|
if (this._animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { permitUnload } = this.#currentBrowser.permitUnload();
|
if (!skipPermitUnload) {
|
||||||
if (!permitUnload) {
|
let { permitUnload } = this.#currentBrowser.permitUnload();
|
||||||
return;
|
if (!permitUnload) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
|
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
|
||||||
@@ -545,7 +547,7 @@
|
|||||||
this.overlay.classList.remove('zen-glance-overlay');
|
this.overlay.classList.remove('zen-glance-overlay');
|
||||||
this._clearContainerStyles(this.browserWrapper);
|
this._clearContainerStyles(this.browserWrapper);
|
||||||
this.animatingFullOpen = false;
|
this.animatingFullOpen = false;
|
||||||
this.closeGlance({ noAnimation: true });
|
this.closeGlance({ noAnimation: true, skipPermitUnload: true });
|
||||||
this.#glances.delete(this.#currentGlanceID);
|
this.#glances.delete(this.#currentGlanceID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +634,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.gZenGlanceManager = new ZenGlanceManager();
|
window.gZenGlanceManager = new ZenGlanceManager();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user