Reset theme on close of settings modal

Этот коммит содержится в:
JoramWilander
2016-02-09 13:47:58 -05:00
родитель dc186240d5
Коммит d927a8c59f

Просмотреть файл

@@ -113,6 +113,7 @@ class UserSettingsModal extends React.Component {
return false; return false;
} }
this.resetTheme();
this.deactivateTab(); this.deactivateTab();
this.props.onModalDismissed(); this.props.onModalDismissed();
} }
@@ -215,15 +216,19 @@ class UserSettingsModal extends React.Component {
this.showConfirmModal(() => this.updateSection(section, true)); this.showConfirmModal(() => this.updateSection(section, true));
} else { } else {
if (this.state.active_section === 'theme' && section !== 'theme') { if (this.state.active_section === 'theme' && section !== 'theme') {
const user = UserStore.getCurrentUser(); this.resetTheme();
if (user.theme_props != null) {
Utils.applyTheme(user.theme_props);
}
} }
this.setState({active_section: section}); this.setState({active_section: section});
} }
} }
resetTheme() {
const user = UserStore.getCurrentUser();
if (user.theme_props != null) {
Utils.applyTheme(user.theme_props);
}
}
render() { render() {
const {formatMessage} = this.props.intl; const {formatMessage} = this.props.intl;
var tabs = []; var tabs = [];