move getThemes -> settings -> componentWillMount

This commit is contained in:
btzr-io 2017-08-24 10:29:54 -06:00
parent 8b8c9c9da9
commit c257691b57
2 changed files with 10 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import { doClearCache } from "actions/app";
import { import {
doSetDaemonSetting, doSetDaemonSetting,
doSetClientSetting, doSetClientSetting,
doGetThemes,
doSetTheme, doSetTheme,
} from "actions/settings"; } from "actions/settings";
import { selectDaemonSettings, selectShowNsfw } from "selectors/settings"; import { selectDaemonSettings, selectShowNsfw } from "selectors/settings";
@ -19,6 +20,7 @@ const perform = dispatch => ({
clearCache: () => dispatch(doClearCache()), clearCache: () => dispatch(doClearCache()),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setTheme: name => dispatch(doSetTheme(name)), setTheme: name => dispatch(doSetTheme(name)),
getThemes: () => dispatch(doGetThemes),
}); });
export default connect(select, perform)(SettingsPage); export default connect(select, perform)(SettingsPage);

View file

@ -51,6 +51,10 @@ class SettingsPage extends React.PureComponent {
this.props.setTheme(value); this.props.setTheme(value);
} }
getThemes() {
this.props.getThemes();
}
onRunOnStartChange(event) { onRunOnStartChange(event) {
this.setDaemonSetting("run_on_startup", event.target.checked); this.setDaemonSetting("run_on_startup", event.target.checked);
} }
@ -114,6 +118,10 @@ class SettingsPage extends React.PureComponent {
onShowUnavailableChange(event) {} onShowUnavailableChange(event) {}
componentWillMount() {
this.getThemes();
}
componentDidMount() {} componentDidMount() {}
render() { render() {