summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-09 13:47:58 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-09 13:47:58 -0500
commitd927a8c59f362ab15e8c5ccd9bb232e368100eef (patch)
tree183ba8e7e06fbbe0af4beb90fbaed07f947dbd13
parentdc186240d559a230445d3193e7468d30721ad10c (diff)
downloadchat-d927a8c59f362ab15e8c5ccd9bb232e368100eef.tar.gz
chat-d927a8c59f362ab15e8c5ccd9bb232e368100eef.tar.bz2
chat-d927a8c59f362ab15e8c5ccd9bb232e368100eef.zip
Reset theme on close of settings modal
-rw-r--r--web/react/components/user_settings/user_settings_modal.jsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx
index 90f28822b..a7541073e 100644
--- a/web/react/components/user_settings/user_settings_modal.jsx
+++ b/web/react/components/user_settings/user_settings_modal.jsx
@@ -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 = [];