From e7f565f143d6d920667fe1860cec19b8ec3bbba9 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sun, 5 Oct 2025 23:55:17 -0700 Subject: [PATCH] Don't allow saving segments on share page. --- src/components/input/FilterBar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/input/FilterBar.tsx b/src/components/input/FilterBar.tsx index 96ad51b4..b81f77e3 100644 --- a/src/components/input/FilterBar.tsx +++ b/src/components/input/FilterBar.tsx @@ -25,13 +25,14 @@ export function FilterBar({ websiteId }: { websiteId: string }) { const { formatValue } = useFormat(); const { router, + pathname, updateParams, replaceParams, query: { segment, cohort }, } = useNavigation(); const { filters, operatorLabels } = useFilters(); const { data, isLoading } = useWebsiteSegmentQuery(websiteId, segment || cohort); - const canSaveSegment = filters.length > 0 && !segment && !cohort; + const canSaveSegment = filters.length > 0 && !segment && !cohort && !pathname.includes('/share'); const handleCloseFilter = (param: string) => { router.push(updateParams({ [param]: undefined }));