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 clear all filters button.

Mike Cao310cf0b2210f
diff --git a/src/components/metrics/FilterTags.tsx b/src/components/metrics/FilterTags.tsx
index 140385f5c..1b168a283 100644
--- a/src/components/metrics/FilterTags.tsx
+++ b/src/components/metrics/FilterTags.tsx
@@ -19,11 +19,11 @@ export function FilterTags({ params }) {
}
function handleCloseFilter(param?: string) {
- if (!param) {
- router.push(makeUrl({ view }, true));
- } else {
- router.push(makeUrl({ [param]: undefined }));
- }
+ router.push(makeUrl({ [param]: undefined }));
+ }
+
+ function handleResetFilter() {
+ router.push(makeUrl({ view }, true));
}
return (
@@ -44,7 +44,7 @@ export function FilterTags({ params }) {
</div>
);
})}
- <Button size="sm" variant="quiet" onClick={handleCloseFilter}>
+ <Button size="sm" variant="quiet" onClick={handleResetFilter}>
<Icon>
<Icons.Close />
</Icon>