Use a settings watcher to set the theme

Rather than listening for account data updates manually
This commit is contained in:
David Baker 2019-11-19 22:36:55 +00:00
parent a0dbd5f62c
commit 80ee68a42f
2 changed files with 12 additions and 11 deletions

View file

@ -175,6 +175,9 @@ export default class GeneralUserSettingsTab extends React.Component {
SettingsStore.setValue("theme", null, SettingLevel.ACCOUNT, newTheme);
this.setState({theme: newTheme});
// The settings watcher doesn't fire until the echo comes back from the
// server, so to make the theme change immediately we need to manually
// do the dispatch now
dis.dispatch({action: 'set_theme', value: newTheme});
};