FIX: Quoting an expanded first post would force it to reload the cooked

This commit is contained in:
Robin Ward 2017-05-01 15:00:59 -04:00
parent 0722ffadf1
commit 3736b440cb

View File

@ -448,11 +448,18 @@ export default RestModel.extend({
return this._identityMap[id]; return this._identityMap[id];
}, },
loadPost(postId){ loadPost(postId) {
const url = "/posts/" + postId; const url = "/posts/" + postId;
const store = this.store; 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));
});
}, },
/** /**