mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Don't allow saving segments on share page.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
This commit is contained in:
parent
dbac6192db
commit
e7f565f143
1 changed files with 2 additions and 1 deletions
|
|
@ -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 }));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue