FIX: Quote widget vanished on Messages

This commit is contained in:
Robin Ward 2015-03-27 11:50:09 -04:00
parent 9633cfeae1
commit 7a38360fbd
1 changed files with 5 additions and 2 deletions

View File

@ -19,8 +19,11 @@ export default DiscourseController.extend({
// anonymous users cannot "quote-reply"
if (!this.currentUser) return;
// don't display the "quote-reply" button if we can't at least reply as a new topic
if (!this.get('controllers.topic.model.details.can_reply_as_new_topic')) return;
// don't display the "quote-reply" button if we can't reply
const topicDetails = this.get('controllers.topic.model.details');
if (!(topicDetails.get('can_reply_as_new_topic') || topicDetails.get('can_create_post'))) {
return;
}
const selection = window.getSelection();
// no selections