FIX: envelope link on suggested topics

This commit is contained in:
Blake Erickson 2018-03-14 16:01:55 -06:00
parent 20ba54d536
commit d3f5b4e4b0

View File

@ -7,8 +7,9 @@ export default Ember.Component.extend({
@computed('topic')
suggestedTitle(topic) {
return topic.get('isPrivateMessage') ?
`<a href="${this.get('pmPath')}">${iconHTML('envelope', { class: 'private-message-glyph' })}</a> ${I18n.t("suggested_topics.pm_title")}` :
const href = this.currentUser && this.currentUser.pmPath(topic);
return topic.get('isPrivateMessage') && href ?
`<a href="${href}">${iconHTML('envelope', { class: 'private-message-glyph' })}</a> ${I18n.t("suggested_topics.pm_title")}` :
I18n.t("suggested_topics.title");
},