Bug 1843587 - Change getClosedTabData param to default to non-private window object r=sfoster,fxview-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183739
This commit is contained in:
@@ -168,15 +168,17 @@ class RecentlyClosedTabsList extends MozLitElement {
|
|||||||
|
|
||||||
getClosedTabsDataForOpenWindows() {
|
getClosedTabsDataForOpenWindows() {
|
||||||
// get closed tabs in currently-open windows
|
// get closed tabs in currently-open windows
|
||||||
const closedTabsData = lazy.SessionStore.getClosedTabData().map(tabData => {
|
const closedTabsData = lazy.SessionStore.getClosedTabData(getWindow()).map(
|
||||||
// flatten the object; move properties of `.state` into the top-level object
|
tabData => {
|
||||||
const stateData = tabData.state;
|
// flatten the object; move properties of `.state` into the top-level object
|
||||||
delete tabData.state;
|
const stateData = tabData.state;
|
||||||
return {
|
delete tabData.state;
|
||||||
...tabData,
|
return {
|
||||||
...stateData,
|
...tabData,
|
||||||
};
|
...stateData,
|
||||||
});
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
return closedTabsData;
|
return closedTabsData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -428,15 +428,18 @@ export var SessionStore = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the closed tab data associated with all matching windows
|
* Get the closed tab data associated with all matching windows
|
||||||
* @param {Window} [aWindow] Optional window argument used to determine if we're collecting data for private or non-private windows
|
* @param {Window} [aWindow] Optional window argument used to determine if we're collecting data for private or non-private windows, will
|
||||||
|
* default to non-private only due to SessionStoreInternal._getTopWindow(false).
|
||||||
*/
|
*/
|
||||||
getClosedTabData: function ss_getClosedTabData(aWindow) {
|
getClosedTabData: function ss_getClosedTabData(aWindow) {
|
||||||
if (!SessionStoreInternal._closedTabsFromAllWindowsEnabled) {
|
if (!SessionStoreInternal._closedTabsFromAllWindowsEnabled) {
|
||||||
return this.getClosedTabDataForWindow(
|
return this.getClosedTabDataForWindow(
|
||||||
aWindow ?? SessionStoreInternal._getTopWindow()
|
aWindow ?? SessionStoreInternal._getTopWindow(false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return SessionStoreInternal.getClosedTabData(aWindow);
|
return SessionStoreInternal.getClosedTabData(
|
||||||
|
aWindow ?? SessionStoreInternal._getTopWindow(false)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user