diff --git a/app/assets/javascripts/discourse/models/post-stream.js.es6 b/app/assets/javascripts/discourse/models/post-stream.js.es6 index 8fe2c7736..2d188aa07 100644 --- a/app/assets/javascripts/discourse/models/post-stream.js.es6 +++ b/app/assets/javascripts/discourse/models/post-stream.js.es6 @@ -326,20 +326,20 @@ const PostStream = Ember.Object.extend({ // Commit the post we staged. Call this after a save succeeds. commitPost(post) { - if (this.get('loadedAllPosts')) { - this.appendPost(post); - } - // Correct for a dangling deleted post, if needed - // compensating for message bus pumping in new posts while - // your post is in transit - if(this.get('topic.highest_post_number') < post.get('post_number')){ - this.set('topic.highest_post_number', post.get('post_number')); + + // cleanup + if (this.get('topic.id') === post.get('topic_id')) { + if (this.get('loadedAllPosts')) { + this.appendPost(post); + } else { + // I guess we might as well keep the data + this.storePost(post); + } } + this.get('stream').removeObject(-1); this.get('postIdentityMap').set(-1, null); - this.get('postIdentityMap').set(post.get('id'), post); - this.get('stream').addObject(post.get('id')); this.set('stagingPost', false); },