summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-13 15:39:53 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-17 15:22:56 -0400
commit079538d9e7d22cd8d5f782f4f7434858bd80d914 (patch)
treee6fe87c2dd1fc4a1782a985b7a0ec961f85f3aa9 /web/react/components/user_settings.jsx
parentfb42a74613a6a5c4ebe316cf6e528d74aa74bb78 (diff)
downloadchat-079538d9e7d22cd8d5f782f4f7434858bd80d914.tar.gz
chat-079538d9e7d22cd8d5f782f4f7434858bd80d914.tar.bz2
chat-079538d9e7d22cd8d5f782f4f7434858bd80d914.zip
Use User.FirstName for notifications instead of trying to determine it from User.Nickname
Diffstat (limited to 'web/react/components/user_settings.jsx')
-rw-r--r--web/react/components/user_settings.jsx23
1 files changed, 7 insertions, 16 deletions
diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index e6eb2b451..59c97c309 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -156,6 +156,8 @@ var NotificationsTab = React.createClass({
var self = this;
+ var user = this.props.user;
+
var desktopSection;
if (this.props.activeSection === 'desktop') {
var notifyActive = [false, false, false];
@@ -314,20 +316,14 @@ var NotificationsTab = React.createClass({
var keysSection;
if (this.props.activeSection === 'keys') {
- var user = this.props.user;
- var first_name = "";
- if (user.nickname.length > 0) {
- first_name = user.nickname.split(' ')[0];
- }
-
var inputs = [];
- if (first_name != "") {
+ if (user.first_name) {
inputs.push(
<div>
<div className="checkbox">
<label>
- <input type="checkbox" checked={this.state.first_name_key} onChange={function(e){self.updateFirstNameKey(e.target.checked);}}>{'Your case sensitive first name "' + first_name + '"'}</input>
+ <input type="checkbox" checked={this.state.first_name_key} onChange={function(e){self.updateFirstNameKey(e.target.checked);}}>{'Your case sensitive first name "' + user.first_name + '"'}</input>
</label>
</div>
</div>
@@ -396,14 +392,9 @@ var NotificationsTab = React.createClass({
);
} else {
var keys = [];
- if (this.state.first_name_key) {
- var first_name = "";
- var user = this.props.user;
- if (user.nickname.length > 0) first_name = user.nickname.split(' ')[0];
- if (first_name != "") keys.push(first_name);
- }
- if (this.state.username_key) keys.push(this.props.user.username);
- if (this.state.mention_key) keys.push('@'+this.props.user.username);
+ if (this.state.first_name_key) keys.push(user.first_name);
+ if (this.state.username_key) keys.push(user.username);
+ if (this.state.mention_key) keys.push('@'+user.username);
if (this.state.all_key) keys.push('@all');
if (this.state.channel_key) keys.push('@channel');
if (this.state.custom_keys.length > 0) keys = keys.concat(this.state.custom_keys.split(','));