diff --git a/src/routes/Reader/SettingsBar/ThemesContainer/ThemesContainer.tsx b/src/routes/Reader/SettingsBar/ThemesContainer/ThemesContainer.tsx index 30b6b32..8185091 100644 --- a/src/routes/Reader/SettingsBar/ThemesContainer/ThemesContainer.tsx +++ b/src/routes/Reader/SettingsBar/ThemesContainer/ThemesContainer.tsx @@ -5,6 +5,7 @@ import styles from './ThemesContainer.module.scss' import { useAppDispatch, useAppSelector } from '@store/hooks' import { Theme } from '@store/slices/EpubJSBackend/data/theme/themeManager.d'; import { setThemeThunk } from '@store/slices/EpubJSBackend/data/theme/themeManager'; +import { setSelectedTheme } from '@store/slices/appState'; interface ThemeInterface{ [name: string]: Theme @@ -30,6 +31,10 @@ const ThemesContainer = ()=>{ const {background, color} = (appThemes[item].reader).body return (
{ + // This will select and save the global theme. + dispatch(setSelectedTheme(item)) + + // Below will simply update the rendition themes. if(isDualReaderMode){ dispatch(setThemeThunk({themeName: item, view:0})) dispatch(setThemeThunk({themeName: item, view:1})) diff --git a/src/store/slices/appState.ts b/src/store/slices/appState.ts index b34409e..d2c28bd 100644 --- a/src/store/slices/appState.ts +++ b/src/store/slices/appState.ts @@ -69,7 +69,8 @@ export const appState = createSlice({ }, extraReducers(builder) { builder.addCase(setThemeThunk.pending, (state, action)=>{ - state.selectedTheme = action.meta.arg.themeName + // We will comment this out for consistency, since the bookstate setThemeThunk should not set the global app theme. + // state.selectedTheme = action.meta.arg.themeName }) }, })