mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 17:25:50 +03:00
Remove sorting by index as it is already done here: e9ea3cad76/src/autocomplete/QueryMatcher.ts (L120)
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
2c66adcb0e
commit
d0ea842f1e
1 changed files with 0 additions and 10 deletions
|
@ -32,15 +32,6 @@ import SettingsStore from "../settings/SettingsStore";
|
|||
|
||||
const ROOM_REGEX = /\B#\S*/g;
|
||||
|
||||
function score(query: string, space: string) {
|
||||
const index = space.indexOf(query);
|
||||
if (index === -1) {
|
||||
return Infinity;
|
||||
} else {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
function matcherObject(room: Room, displayedAlias: string, matchName = "") {
|
||||
return {
|
||||
room,
|
||||
|
@ -106,7 +97,6 @@ export default class RoomProvider extends AutocompleteProvider {
|
|||
const matchedString = command[0];
|
||||
completions = this.matcher.match(matchedString, limit);
|
||||
completions = sortBy(completions, [
|
||||
(c) => score(matchedString, c.displayedAlias),
|
||||
(c) => c.displayedAlias.length,
|
||||
]);
|
||||
completions = uniqBy(completions, (match) => match.room);
|
||||
|
|
Loading…
Reference in a new issue