Reset theme on close of settings modal

This commit is contained in:
JoramWilander
2016-02-09 13:47:58 -05:00
parent dc186240d5
commit d927a8c59f

View File

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