mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 15:08:45 +08:00
Fixed search filter bug
This commit is contained in:
parent
4938e3b930
commit
203f78f76b
1 changed files with 3 additions and 5 deletions
|
@ -95,10 +95,8 @@ function updateSuggested() {
|
|||
let escaped = obj2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
||||
let re = new RegExp("\\b" + escaped, "g");
|
||||
let res = obj.display.toLowerCase().match(re);
|
||||
let res2 = null;
|
||||
if (obj.alias !== undefined) {
|
||||
res2 = obj.alias.toLowerCase().match(re);
|
||||
}
|
||||
let res2 =
|
||||
obj.alias !== undefined ? obj.alias.toLowerCase().match(re) : null;
|
||||
if (
|
||||
(res != null && res.length > 0) ||
|
||||
(res2 != null && res2.length > 0)
|
||||
|
@ -108,7 +106,7 @@ function updateSuggested() {
|
|||
foundcount--;
|
||||
}
|
||||
});
|
||||
if (foundcount > 0) {
|
||||
if (foundcount > inputVal.length - 1) {
|
||||
obj.found = true;
|
||||
} else {
|
||||
obj.found = false;
|
||||
|
|
Loading…
Reference in a new issue