summaryrefslogtreecommitdiffstats
path: root/web/react/components/sidebar.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-08-03 12:39:27 -0700
committernickago <ngonella@calpoly.edu>2015-08-03 12:41:39 -0700
commit3db7d315f951db0d443d434d81c9058cca43c361 (patch)
tree749bf01c268d71b507f2c1526805b4c52e89a575 /web/react/components/sidebar.jsx
parentdfcaabe222f0d44b91e0a2e79e000459d28a6d6a (diff)
downloadchat-3db7d315f951db0d443d434d81c9058cca43c361.tar.gz
chat-3db7d315f951db0d443d434d81c9058cca43c361.tar.bz2
chat-3db7d315f951db0d443d434d81c9058cca43c361.zip
Fixed variable naming conflict with msg and added cosmetic refactors
Diffstat (limited to 'web/react/components/sidebar.jsx')
-rw-r--r--web/react/components/sidebar.jsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 5310626a5..1d39f5f67 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -183,10 +183,10 @@ module.exports = React.createClass({
var notifyText = post.message.replace(repRegex, '\n').replace(/\n+/g, ' ').replace('<mention>', '').replace('</mention>', '');
if (notifyText.length > 50) {
- notifyText = msg.substring(0,49) + '...';
+ notifyText = notifyText.substring(0, 49) + '...';
}
- if (msg.length === 0) {
+ if (notifyText.length === 0) {
if (msgProps.image) {
utils.notifyMe(title, username + ' uploaded an image', channel);
} else if (msgProps.otherFile) {
@@ -195,17 +195,17 @@ module.exports = React.createClass({
utils.notifyMe(title, username + ' did something new', channel);
}
} else {
- utils.notifyMe(title, username + ' wrote: ' + msg, channel);
+ utils.notifyMe(title, username + ' wrote: ' + notifyText, channel);
}
if (!user.notify_props || user.notify_props.desktop_sound === 'true') {
utils.ding();
}
}
- } else if (msg.action == 'viewed') {
+ } else if (msg.action === 'viewed') {
if (ChannelStore.getCurrentId() != msg.channel_id) {
AsyncClient.getChannels(true);
}
- } else if (msg.action == 'user_added') {
+ } else if (msg.action === 'user_added') {
if (UserStore.getCurrentId() === msg.user_id) {
AsyncClient.getChannels(true);
}
@@ -231,7 +231,7 @@ module.exports = React.createClass({
var teammate_username = utils.getDirectTeammate(channel.id).username;
document.title = teammate_username + ' ' + document.title.substring(document.title.lastIndexOf('-'));
} else {
- document.title = channel.display_name + ' ' + document.title.substring(document.title.lastIndexOf('-'))
+ document.title = channel.display_name + ' ' + document.title.substring(document.title.lastIndexOf('-'));
}
}
},