From 022a38139735513beca743ea1b01ed128dd67270 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 12 Feb 2021 14:45:22 -0500 Subject: [PATCH] onChangeTheme: Guard against uninitialized redux --- ts/background.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ts/background.ts b/ts/background.ts index f50056ae05..3549b95104 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2162,10 +2162,12 @@ type WhatIsThis = import('./window.d').WhatIsThis; view.applyTheme(); } - const theme = window.Events.getThemeSetting(); - window.reduxActions.user.userChanged({ - theme: theme === 'system' ? window.systemTheme : theme, - }); + if (window.reduxActions && window.reduxActions.user) { + const theme = window.Events.getThemeSetting(); + window.reduxActions.user.userChanged({ + theme: theme === 'system' ? window.systemTheme : theme, + }); + } } const FIVE_MINUTES = 5 * 60 * 1000;