FIX: error messages missing if topic edit failed in composer

This commit is contained in:
Sam 2015-08-11 17:08:30 +10:00
parent ccc943c118
commit b3297d0d62
1 changed files with 7 additions and 5 deletions

View File

@ -493,15 +493,17 @@ const Composer = RestModel.extend({
this.set('composeState', CLOSED);
var rollback = throwAjaxError(function(){
post.set('cooked', oldCooked);
self.set('composeState', OPEN);
});
return promise.then(function() {
return post.save(props).then(function(result) {
self.clearState();
return result;
}).catch(throwAjaxError(function() {
post.set('cooked', oldCooked);
self.set('composeState', OPEN);
}));
});
}).catch(rollback);
}).catch(rollback);
},
serialize(serializer, dest) {