onChangeTheme: Guard against uninitialized redux

This commit is contained in:
Josh Perez 2021-02-12 14:45:22 -05:00 committed by GitHub
parent 45d2df8d2b
commit 022a381397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;