mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 21:33:40 +08:00
Merge pull request #1469 from Estebene/search-filter
Fixed search filter bug
This commit is contained in:
commit
d49cdcebca
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