Skip to content

Commit

Permalink
fix: crash if changing theme before default user config loaded (#2102)
Browse files Browse the repository at this point in the history
  • Loading branch information
ert78gb authored Oct 7, 2023
1 parent 1bbfd00 commit a377c69
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export function reducer(state = initialState, action: Actions | AppActions.Actio

case AppActions.ActionTypes.SetAppTheme: {
const theme = (action as AppActions.SetAppThemeAction).payload;

if (!state.userConfiguration) {
return {
...state,
theme
};
}

const userConfiguration = state.userConfiguration.clone();
setSvgKeyboardCoverColorsOfAllLayer(userConfiguration, theme);

Expand Down

0 comments on commit a377c69

Please sign in to comment.