diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index 18378f9aeed..e58f62362ea 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -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) {