1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 03:33:14 +01:00

allow search key name too

This commit is contained in:
Mikael Finstad 2024-08-23 20:52:20 +02:00
parent 19224bff2c
commit 9f45e290e6
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -673,10 +673,11 @@ const KeyboardShortcuts = memo(({
}, []); }, []);
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const actionEntries = useMemo(() => (Object.entries(actionsMap) as any as [keyof typeof actionsMap, typeof actionsMap[keyof typeof actionsMap]][]).filter(([, { name, category }]) => { const actionEntries = useMemo(() => (Object.entries(actionsMap) as any as [keyof typeof actionsMap, typeof actionsMap[keyof typeof actionsMap]][]).filter(([key, { name, category }]) => {
const searchQueryTrimmed = searchQuery.toLowerCase().trim(); const searchQueryTrimmed = searchQuery.toLowerCase().trim();
return ( return (
!searchQuery !searchQuery
|| key.toLocaleLowerCase().includes(searchQueryTrimmed)
|| name.toLowerCase().includes(searchQueryTrimmed) || name.toLowerCase().includes(searchQueryTrimmed)
|| (category != null && category.toLowerCase().includes(searchQueryTrimmed)) || (category != null && category.toLowerCase().includes(searchQueryTrimmed))
); );