diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-27 11:52:13 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-27 11:52:13 -0700 |
commit | a133f82421d2c67ef32b0aae69a6646a14f97dfc (patch) | |
tree | 35fe7dcf6b208437111c5d3a843eabf2f4703101 /web/react/components/mention_list.jsx | |
parent | e22b9f53034280cd3b730c03520469dca4046484 (diff) | |
parent | e0f69060fa462390779dd7b4cf6b67a12c3974ba (diff) | |
download | chat-a133f82421d2c67ef32b0aae69a6646a14f97dfc.tar.gz chat-a133f82421d2c67ef32b0aae69a6646a14f97dfc.tar.bz2 chat-a133f82421d2c67ef32b0aae69a6646a14f97dfc.zip |
Merge branch 'master' into PLT-340
Diffstat (limited to 'web/react/components/mention_list.jsx')
-rw-r--r-- | web/react/components/mention_list.jsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx index 8c1da942d..61a24c09c 100644 --- a/web/react/components/mention_list.jsx +++ b/web/react/components/mention_list.jsx @@ -2,7 +2,7 @@ // See License.txt for license information. var UserStore = require('../stores/user_store.jsx'); -var PostStore = require('../stores/post_store.jsx'); +var SearchStore = require('../stores/search_store.jsx'); var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); var Mention = require('./mention.jsx'); @@ -66,7 +66,7 @@ export default class MentionList extends React.Component { } } componentDidMount() { - PostStore.addMentionDataChangeListener(this.onListenerChange); + SearchStore.addMentionDataChangeListener(this.onListenerChange); $('.post-right__scroll').scroll(this.onScroll); @@ -74,7 +74,7 @@ export default class MentionList extends React.Component { $(document).click(this.onClick); } componentWillUnmount() { - PostStore.removeMentionDataChangeListener(this.onListenerChange); + SearchStore.removeMentionDataChangeListener(this.onListenerChange); $('body').off('keydown.mentionlist', '#' + this.props.id); } @@ -217,12 +217,17 @@ export default class MentionList extends React.Component { if (this.state.selectedMention === index) { isFocused = 'mentions-focus'; } + + if (!users[i].secondary_text) { + users[i].secondary_text = Utils.getFullName(users[i]); + } + mentions[index] = ( <Mention key={'mention_key_' + index} ref={'mention' + index} username={users[i].username} - secondary_text={Utils.getFullName(users[i])} + secondary_text={users[i].secondary_text} id={users[i].id} listId={index} isFocused={isFocused} |