Move theme setting to settings store
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
ActionTypes,
|
||||
SettingsState,
|
||||
TopicOrder,
|
||||
Action,
|
||||
} from '../reducers/Settings'
|
||||
import { Base64Message } from '../../../backend/src/Model/Base64Message';
|
||||
|
||||
@@ -152,3 +153,10 @@ function autoExpandLimitForTree(tree: q.Tree<TopicViewModel>) {
|
||||
|
||||
return closestExistingLimit(calculatedLimit)
|
||||
}
|
||||
|
||||
export const toggleTheme = () => (dispatch: Dispatch<any>, getState: () => AppState) => {
|
||||
dispatch({
|
||||
type: getState().settings.theme === 'light' ? ActionTypes.SETTINGS_SET_THEME_DARK : ActionTypes.SETTINGS_SET_THEME_LIGHT,
|
||||
})
|
||||
dispatch(storeSettings())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user