commit a0b293e34d9651ebf55f4479ebc94c7de999f68b
parent f14a3d55f9afade401789c12465ebb1ea397fb83
Author: scottdowne <sdowne@mozilla.com>
Date: Fri, 24 Oct 2025 17:48:22 +0000
Bug 1996034 - Newtab guard against older cached data not having on demand spocs r=home-newtab-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D269882
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/browser/extensions/newtab/common/Reducers.sys.mjs b/browser/extensions/newtab/common/Reducers.sys.mjs
@@ -828,7 +828,8 @@ function DiscoveryStream(prevState = INITIAL_STATE.DiscoveryStream, action) {
if (action.data) {
// If spocs have been loaded on this tab, we can ignore future updates.
// This should never be true on the main store, only content pages.
- if (prevState.spocs.onDemand.loaded) {
+ // We check agasint onDemand just to be safe. It generally shouldn't be needed.
+ if (prevState.spocs?.onDemand?.loaded) {
return prevState;
}
return {
diff --git a/browser/extensions/newtab/data/content/activity-stream.bundle.js b/browser/extensions/newtab/data/content/activity-stream.bundle.js
@@ -7969,7 +7969,8 @@ function DiscoveryStream(prevState = INITIAL_STATE.DiscoveryStream, action) {
if (action.data) {
// If spocs have been loaded on this tab, we can ignore future updates.
// This should never be true on the main store, only content pages.
- if (prevState.spocs.onDemand.loaded) {
+ // We check agasint onDemand just to be safe. It generally shouldn't be needed.
+ if (prevState.spocs?.onDemand?.loaded) {
return prevState;
}
return {