summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-10-26 12:05:09 -0400
committerJoramWilander <jwawilander@gmail.com>2015-10-26 12:05:09 -0400
commitfda62fbbf576ead8aea3b4a39a167b7f2d218142 (patch)
tree1e4ea60dbe93dbaaa1ec09f6a5dd4bd8b4cab02f /web
parentb46c01b2903d49903cfcf6588097cb72d599b391 (diff)
downloadchat-fda62fbbf576ead8aea3b4a39a167b7f2d218142.tar.gz
chat-fda62fbbf576ead8aea3b4a39a167b7f2d218142.tar.bz2
chat-fda62fbbf576ead8aea3b4a39a167b7f2d218142.zip
Fix error message on leaving channel
Diffstat (limited to 'web')
-rw-r--r--web/react/stores/socket_store.jsx2
-rw-r--r--web/react/utils/async_client.jsx4
-rw-r--r--web/react/utils/constants.jsx1
3 files changed, 4 insertions, 3 deletions
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index 9410c1e9c..d4b0e62db 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -160,7 +160,7 @@ function handleNewPostEvent(msg) {
if (window.isActive) {
AsyncClient.updateLastViewedAt(true);
}
- } else {
+ } else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) {
AsyncClient.getChannel(msg.channel_id);
}
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index b1bc71d54..75dd35e3f 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -132,7 +132,7 @@ export function getChannel(id) {
callTracker['getChannel' + id] = utils.getTimestamp();
client.getChannel(id,
- function getChannelSuccess(data, textStatus, xhr) {
+ (data, textStatus, xhr) => {
callTracker['getChannel' + id] = 0;
if (xhr.status === 304 || !data) {
@@ -145,7 +145,7 @@ export function getChannel(id) {
member: data.member
});
},
- function getChannelFailure(err) {
+ (err) => {
callTracker['getChannel' + id] = 0;
dispatchError(err, 'getChannel');
}
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index c20d84f40..f31bf6740 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -98,6 +98,7 @@ module.exports = {
POST_LOADING: 'loading',
POST_FAILED: 'failed',
POST_DELETED: 'deleted',
+ POST_TYPE_JOIN_LEAVE: 'join_leave',
RESERVED_TEAM_NAMES: [
'www',
'web',