FIX: Quote button was broken when the quoted post was unloaded

This commit is contained in:
Robin Ward 2015-10-23 12:48:15 -04:00
parent f3d9d1295a
commit 09195768be
2 changed files with 5 additions and 4 deletions

View File

@ -101,8 +101,10 @@ export default Ember.Controller.extend({
// defer load if needed, if in an expanded replies section
if (!post) {
const postStream = this.get('controllers.topic.model.postStream');
postStream.loadPost(postId).then(() => this.quoteText());
return;
return postStream.loadPost(postId).then(p => {
this.set('post', p);
return this.quoteText();
});
}
// If we can't create a post, delegate to reply as new topic

View File

@ -445,8 +445,7 @@ const PostStream = RestModel.extend({
const url = "/posts/" + postId;
const store = this.store;
return Discourse.ajax(url).then((p) =>
this.storePost(store.createRecord('post', p)));
return Discourse.ajax(url).then(p => this.storePost(store.createRecord('post', p)));
},
/**