summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
}