Skip to content

Commit

Permalink
FIX: Quoting an expanded first post would force it to reload the cooked
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed May 1, 2017
1 parent 0722ffa commit 3736b44
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/assets/javascripts/discourse/models/post-stream.js.es6
Expand Up @@ -448,11 +448,18 @@ export default RestModel.extend({
return this._identityMap[id];
},

loadPost(postId){
loadPost(postId) {
const url = "/posts/" + postId;
const store = this.store;
const existing = this._identityMap[postId];

return ajax(url).then(p => this.storePost(store.createRecord('post', p)));
return ajax(url).then(p => {
if (existing) {
p.cooked = existing.cooked;
}

return this.storePost(store.createRecord('post', p));
});
},

/**
Expand Down

0 comments on commit 3736b44

Please sign in to comment.