fix: Allow querying by email address in share popover

This commit is contained in:
Tom Moor
2024-02-04 18:27:06 -05:00
parent 8ee266f7b1
commit 930210e46d
2 changed files with 27 additions and 10 deletions

View File

@@ -426,15 +426,22 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
}
return (
(item.title || "").toLowerCase().includes(searchInput) ||
(item.keywords || "").toLowerCase().includes(searchInput)
(item.title || "").toLocaleLowerCase().includes(searchInput) ||
(item.keywords || "").toLocaleLowerCase().includes(searchInput)
);
});
return filterExcessSeparators(
filtered.sort((item) =>
searchInput && item.title ? commandScore(item.title, searchInput) : 0
)
filtered
.map((item) => ({
item,
score:
searchInput && item.title
? commandScore(item.title, searchInput)
: 0,
}))
.sort((a, b) => b.score - a.score)
.map(({ item }) => item)
);
}, [commands, props]);