mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-05 17:05:46 +01:00
Use original search value if no results.
This commit is contained in:
parent
a18d1a923c
commit
726212120f
@ -28,7 +28,8 @@ export function useWebsiteValues({
|
||||
const getSearch = (type: string, value: string) => {
|
||||
if (value) {
|
||||
const values = names[type];
|
||||
return Object.keys(values)
|
||||
return (
|
||||
Object.keys(values)
|
||||
.reduce((arr: string[], key: string) => {
|
||||
if (values[key].toLowerCase().includes(value.toLowerCase())) {
|
||||
return arr.concat(key);
|
||||
@ -36,7 +37,8 @@ export function useWebsiteValues({
|
||||
return arr;
|
||||
}, [])
|
||||
.slice(0, 5)
|
||||
.join(',');
|
||||
.join(',') || value
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user