Skip to content
Permalink
Browse files

strip (IRC) displayname suffix from autocomplete

  • Loading branch information
aviraldg committed Aug 3, 2016
1 parent 89d2a56 commit 2cddf18461851c851d75eea55b21e830325754a5
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/autocomplete/UserProvider.js
@@ -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'],
});
}

@@ -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

0 comments on commit 2cddf18

Please sign in to comment.
You can’t perform that action at this time.