summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/common
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /browser/components/newtab/common
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/newtab/common')
-rw-r--r--browser/components/newtab/common/Actions.mjs5
-rw-r--r--browser/components/newtab/common/Reducers.sys.mjs21
2 files changed, 26 insertions, 0 deletions
diff --git a/browser/components/newtab/common/Actions.mjs b/browser/components/newtab/common/Actions.mjs
index 7273d80220..a86a1d1e81 100644
--- a/browser/components/newtab/common/Actions.mjs
+++ b/browser/components/newtab/common/Actions.mjs
@@ -161,6 +161,11 @@ for (const type of [
"UPDATE_SEARCH_SHORTCUTS",
"UPDATE_SECTION_PREFS",
"WALLPAPERS_SET",
+ "WALLPAPER_CLICK",
+ "WEATHER_IMPRESSION",
+ "WEATHER_LOAD_ERROR",
+ "WEATHER_OPEN_PROVIDER_URL",
+ "WEATHER_UPDATE",
"WEBEXT_CLICK",
"WEBEXT_DISMISS",
]) {
diff --git a/browser/components/newtab/common/Reducers.sys.mjs b/browser/components/newtab/common/Reducers.sys.mjs
index 326217538d..edd3668434 100644
--- a/browser/components/newtab/common/Reducers.sys.mjs
+++ b/browser/components/newtab/common/Reducers.sys.mjs
@@ -104,6 +104,12 @@ export const INITIAL_STATE = {
Wallpapers: {
wallpaperList: [],
},
+ Weather: {
+ // do we have the data from WeatherFeed yet?
+ initialized: false,
+ suggestions: [],
+ lastUpdated: null,
+ },
};
function App(prevState = INITIAL_STATE.App, action) {
@@ -853,6 +859,20 @@ function Wallpapers(prevState = INITIAL_STATE.Wallpapers, action) {
}
}
+function Weather(prevState = INITIAL_STATE.Weather, action) {
+ switch (action.type) {
+ case at.WEATHER_UPDATE:
+ return {
+ ...prevState,
+ suggestions: action.data.suggestions,
+ lastUpdated: action.data.date,
+ initialized: true,
+ };
+ default:
+ return prevState;
+ }
+}
+
export const reducers = {
TopSites,
App,
@@ -865,4 +885,5 @@ export const reducers = {
DiscoveryStream,
Search,
Wallpapers,
+ Weather,
};