Merge pull request #2118 from mattermost/reset-theme-fix

Reset theme on close of settings modal
Этот коммит содержится в:
Christopher Speller
2016-02-09 14:04:14 -05:00
родитель dc186240d5 d927a8c59f
Коммит 81b2669866

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

@@ -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 = [];