Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #375 from aviraldg/fix-574
Browse files Browse the repository at this point in the history
strip (IRC) displayname suffix from autocomplete
  • Loading branch information
ara4n committed Aug 3, 2016
2 parents f431e62 + 2cddf18 commit 104ccc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/autocomplete/UserProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ let instance = null;
export default class UserProvider extends AutocompleteProvider {
constructor() {
super(USER_REGEX, {
keys: ['displayName', 'userId'],
keys: ['name', 'userId'],
});
this.users = [];
this.fuse = new Fuse([], {
keys: ['displayName', 'userId'],
keys: ['name', 'userId'],
});
}

Expand All @@ -25,11 +25,12 @@ export default class UserProvider extends AutocompleteProvider {
if (command) {
this.fuse.set(this.users);
completions = this.fuse.search(command[0]).map(user => {
const displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done
return {
completion: user.userId,
component: (
<TextualCompletion
title={user.displayName || user.userId}
title={displayName}
description={user.userId} />
),
range
Expand Down

0 comments on commit 104ccc7

Please sign in to comment.