summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-11-24 15:05:53 -0500
committerChristopher Speller <crspeller@gmail.com>2015-11-24 15:05:53 -0500
commitb1d89e42ffe68702253e7602173d74c97417d863 (patch)
treec737e54655753ffc2989ca9dc5899f8f3c0e5bc3 /web/react/stores
parent23affc3098614b6fe948772c2767f301f3724a26 (diff)
downloadchat-b1d89e42ffe68702253e7602173d74c97417d863.tar.gz
chat-b1d89e42ffe68702253e7602173d74c97417d863.tar.bz2
chat-b1d89e42ffe68702253e7602173d74c97417d863.zip
Fixing pending post deletion on other clients.
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/post_store.jsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index c76560c25..24b0d0dd0 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -399,10 +399,12 @@ class PostStoreClass extends EventEmitter {
Reflect.deleteProperty(postList.posts, pendingPostId);
const index = postList.order.indexOf(pendingPostId);
- if (index !== -1) {
- postList.order.splice(index, 1);
+ if (index === -1) {
+ return;
}
+ postList.order.splice(index, 1);
+
this.postsInfo[channelId].pendingPosts = postList;
this.emitChange();
}