Bug 1838871 - Fallback to previous behaviour of Ctrl-Shift-T if the in-memory undo actions list is empty. r=dao,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D181273
This commit is contained in:
@@ -8163,12 +8163,24 @@ function AddKeywordForSearchField() {
|
||||
function restoreLastClosedTabOrWindowOrSession() {
|
||||
let lastActionTaken = SessionStore.popLastClosedAction();
|
||||
|
||||
if (!lastActionTaken && SessionStore.canRestoreLastSession) {
|
||||
SessionStore.restoreLastSession();
|
||||
} else if (lastActionTaken?.type == SessionStore.LAST_ACTION_CLOSED_TAB) {
|
||||
this.undoCloseTab();
|
||||
} else if (lastActionTaken?.type == SessionStore.LAST_ACTION_CLOSED_WINDOW) {
|
||||
this.undoCloseWindow();
|
||||
if (lastActionTaken) {
|
||||
switch (lastActionTaken.type) {
|
||||
case SessionStore.LAST_ACTION_CLOSED_TAB: {
|
||||
undoCloseTab();
|
||||
break;
|
||||
}
|
||||
case SessionStore.LAST_ACTION_CLOSED_WINDOW: {
|
||||
undoCloseWindow();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let closedTabCount = SessionStore.getLastClosedTabCount(window);
|
||||
if (closedTabCount) {
|
||||
undoCloseTab();
|
||||
} else if (SessionStore.canRestoreLastSession) {
|
||||
SessionStore.restoreLastSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user