Don't allow saving segments on share page.
This commit is contained in:
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user