diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-11-12 11:19:59 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-11-12 11:19:59 -0500 |
commit | 50815f9be7195d736debd6bcd9d300dd95bbc738 (patch) | |
tree | d6060dce1cf036285019eac6ccba1ff07df6ad80 /web/react/components/user_settings/user_settings_notifications.jsx | |
parent | 13a251a5ee940383e5a026284275b1f31fb476df (diff) | |
download | chat-50815f9be7195d736debd6bcd9d300dd95bbc738.tar.gz chat-50815f9be7195d736debd6bcd9d300dd95bbc738.tar.bz2 chat-50815f9be7195d736debd6bcd9d300dd95bbc738.zip |
Rename areStatesEqual to areObjectsEqual and make it more comprehensive and accurate.
Diffstat (limited to 'web/react/components/user_settings/user_settings_notifications.jsx')
-rw-r--r-- | web/react/components/user_settings/user_settings_notifications.jsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/web/react/components/user_settings/user_settings_notifications.jsx b/web/react/components/user_settings/user_settings_notifications.jsx index c6f47804f..c958bf5bc 100644 --- a/web/react/components/user_settings/user_settings_notifications.jsx +++ b/web/react/components/user_settings/user_settings_notifications.jsx @@ -1,16 +1,18 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -var UserStore = require('../../stores/user_store.jsx'); -var SettingItemMin = require('../setting_item_min.jsx'); -var SettingItemMax = require('../setting_item_max.jsx'); -var client = require('../../utils/client.jsx'); -var AsyncClient = require('../../utils/async_client.jsx'); -var utils = require('../../utils/utils.jsx'); +const SettingItemMin = require('../setting_item_min.jsx'); +const SettingItemMax = require('../setting_item_max.jsx'); + +const UserStore = require('../../stores/user_store.jsx'); + +const Client = require('../../utils/client.jsx'); +const AsyncClient = require('../../utils/async_client.jsx'); +const Utils = require('../../utils/utils.jsx'); function getNotificationsStateFromStores() { var user = UserStore.getCurrentUser(); - var soundNeeded = !utils.isBrowserFirefox(); + var soundNeeded = !Utils.isBrowserFirefox(); var sound = 'true'; if (user.notify_props && user.notify_props.desktop_sound) { @@ -116,7 +118,7 @@ export default class NotificationsTab extends React.Component { data.all = this.state.allKey.toString(); data.channel = this.state.channelKey.toString(); - client.updateUserNotifyProps(data, + Client.updateUserNotifyProps(data, function success() { this.props.updateSection(''); AsyncClient.getMe(); @@ -138,7 +140,7 @@ export default class NotificationsTab extends React.Component { } onListenerChange() { var newState = getNotificationsStateFromStores(); - if (!utils.areStatesEqual(newState, this.state)) { + if (!Utils.areObjectsEqual(newState, this.state)) { this.setState(newState); } } |