From b3297d0d625a5046d768fd54a2e4ce214e160ace Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 11 Aug 2015 17:08:30 +1000 Subject: [PATCH] FIX: error messages missing if topic edit failed in composer --- .../javascripts/discourse/models/composer.js.es6 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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) {