FIX: Make sure we decrease post count if new post fails to save.

This commit is contained in:
Guo Xiang Tan 2016-11-10 11:02:11 +08:00
parent 55865024c7
commit 531d649a75
1 changed files with 4 additions and 0 deletions

View File

@ -686,6 +686,10 @@ const Composer = RestModel.extend({
}).catch(throwAjaxError(function() {
if (postStream) {
postStream.undoPost(createdPost);
if (post) {
post.set('reply_count', post.get('reply_count') - 1);
}
}
Ember.run.next(() => composer.set('composeState', OPEN));
}));