Don't allow saving segments on share page.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

This commit is contained in:
Mike Cao 2025-10-05 23:55:17 -07:00
parent dbac6192db
commit e7f565f143

View file

@ -25,13 +25,14 @@ export function FilterBar({ websiteId }: { websiteId: string }) {
const { formatValue } = useFormat(); const { formatValue } = useFormat();
const { const {
router, router,
pathname,
updateParams, updateParams,
replaceParams, replaceParams,
query: { segment, cohort }, query: { segment, cohort },
} = useNavigation(); } = useNavigation();
const { filters, operatorLabels } = useFilters(); const { filters, operatorLabels } = useFilters();
const { data, isLoading } = useWebsiteSegmentQuery(websiteId, segment || cohort); 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) => { const handleCloseFilter = (param: string) => {
router.push(updateParams({ [param]: undefined })); router.push(updateParams({ [param]: undefined }));