Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed filter search.

Mike Cao99559c2b352a
diff --git a/src/components/hooks/queries/useWebsiteValues.ts b/src/components/hooks/queries/useWebsiteValues.ts
index 892af6ad4..73a7c7553 100644
--- a/src/components/hooks/queries/useWebsiteValues.ts
+++ b/src/components/hooks/queries/useWebsiteValues.ts
@@ -28,17 +28,22 @@ export function useWebsiteValues({
const getSearch = (type: string, value: string) => {
if (value) {
const values = names[type];
- return (
- Object.keys(values)
- .reduce((arr: string[], key: string) => {
- if (values[key].toLowerCase().includes(value.toLowerCase())) {
- return arr.concat(key);
- }
- return arr;
- }, [])
- .slice(0, 5)
- .join(',') || value
- );
+
+ if (values) {
+ return (
+ Object.keys(values)
+ .reduce((arr: string[], key: string) => {
+ if (values[key].toLowerCase().includes(value.toLowerCase())) {
+ return arr.concat(key);
+ }
+ return arr;
+ }, [])
+ .slice(0, 5)
+ .join(',') || value
+ );
+ }
+
+ return value;
}
};