retain pre-stripped text so it can be used for rendering
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
54bccd2016
commit
7cdc91856b
2 changed files with 6 additions and 4 deletions
|
@ -45,7 +45,7 @@ export default class RoomProvider extends AutocompleteProvider {
|
|||
constructor() {
|
||||
super(ROOM_REGEX);
|
||||
this.matcher = new FuzzyMatcher([], {
|
||||
keys: ['displayedAlias', 'name'],
|
||||
keys: ['displayedAlias', '_name'],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ export default class RoomProvider extends AutocompleteProvider {
|
|||
return {
|
||||
room: room,
|
||||
name: room.name,
|
||||
_name: stripDiacritics(room.name),
|
||||
displayedAlias: getDisplayAliasForRoom(room),
|
||||
};
|
||||
}));
|
||||
|
|
|
@ -40,11 +40,11 @@ export default class UserProvider extends AutocompleteProvider {
|
|||
|
||||
constructor(room: Room) {
|
||||
super(USER_REGEX, {
|
||||
keys: ['name'],
|
||||
keys: ['_name'],
|
||||
});
|
||||
this.room = room;
|
||||
this.matcher = new FuzzyMatcher([], {
|
||||
keys: ['name', 'userId'],
|
||||
keys: ['_name', 'userId'],
|
||||
shouldMatchPrefix: true,
|
||||
shouldMatchWordsOnly: false,
|
||||
});
|
||||
|
@ -149,7 +149,8 @@ export default class UserProvider extends AutocompleteProvider {
|
|||
if (userId === currentUserId) return; // skip self
|
||||
this.users.push({
|
||||
userId,
|
||||
name: stripDiacritics(name),
|
||||
name,
|
||||
_name: stripDiacritics(name),
|
||||
...rest,
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue