mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-30 20:31:53 +00:00
fix: Fixed closing last tab not closing the window and other refactors, b=closes #10455, c=common, configs, kbs, split-view, folders, tests, workspaces
This commit is contained in:
@@ -1130,7 +1130,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
|
||||
handleTabBeforeClose(tab, closeWindowWithLastTab = false) {
|
||||
handleTabBeforeClose(tab, closeWindowWithLastTab) {
|
||||
if (!this.workspaceEnabled || this.__contextIsDelete || this._removedByStartupPage) {
|
||||
return null;
|
||||
}
|
||||
@@ -1144,7 +1144,8 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
let tabsPinned = tabs.filter(
|
||||
(t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned
|
||||
);
|
||||
const shouldCloseWindow = this.shouldCloseWindow() && closeWindowWithLastTab;
|
||||
const shouldCloseWindow =
|
||||
closeWindowWithLastTab != null ? closeWindowWithLastTab : this.shouldCloseWindow();
|
||||
if (tabs.length === 1 && tabs[0] === tab) {
|
||||
if (shouldCloseWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
|
||||
Reference in New Issue
Block a user