diff --git a/app/assets/javascripts/discourse/lib/transform-post.js.es6 b/app/assets/javascripts/discourse/lib/transform-post.js.es6 index 03ff394ec38..18da1e5993a 100644 --- a/app/assets/javascripts/discourse/lib/transform-post.js.es6 +++ b/app/assets/javascripts/discourse/lib/transform-post.js.es6 @@ -113,6 +113,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos postAtts.actionCodeWho = post.action_code_who; postAtts.userCustomFields = post.user_custom_fields; postAtts.topicUrl = topic.get('url'); + postAtts.isSaving = post.isSaving; const showPMMap = topic.archetype === 'private_message' && post.post_number === 1; if (showPMMap) { diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index 837d97d265b..9ecc0beefec 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -539,7 +539,7 @@ const Composer = RestModel.extend({ cooked: this.getCookedHtml() }; - this.set('composeState', CLOSED); + this.set('composeState', SAVING); var rollback = throwAjaxError(function(){ post.set('cooked', oldCooked); @@ -547,6 +547,8 @@ const Composer = RestModel.extend({ }); return promise.then(function() { + // rest model only sets props after it is saved + post.set("cooked", props.cooked); return post.save(props).then(function(result) { self.clearState(); return result; diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6 index d48e054a736..a1e86d3bf14 100644 --- a/app/assets/javascripts/discourse/widgets/post.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post.js.es6 @@ -401,7 +401,7 @@ export default createWidget('post', { if (attrs.cloaked) { return 'cloaked-post'; } const classNames = ['topic-post', 'clearfix']; - if (attrs.id === -1) { classNames.push('staged'); } + if (attrs.id === -1 || attrs.isSaving) { classNames.push('staged'); } if (attrs.selected) { classNames.push('selected'); } if (attrs.topicOwner) { classNames.push('topic-owner'); } if (attrs.hidden) { classNames.push('post-hidden'); }