Skip to content

Commit 531d649

Browse files
committed
FIX: Make sure we decrease post count if new post fails to save.
1 parent 5586502 commit 531d649

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/assets/javascripts/discourse/models/composer.js.es6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,10 @@ const Composer = RestModel.extend({
686686
}).catch(throwAjaxError(function() {
687687
if (postStream) {
688688
postStream.undoPost(createdPost);
689+
690+
if (post) {
691+
post.set('reply_count', post.get('reply_count') - 1);
692+
}
689693
}
690694
Ember.run.next(() => composer.set('composeState', OPEN));
691695
}));

0 commit comments

Comments
 (0)