mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 05:07:15 +01:00
Updated segment handling.
This commit is contained in:
parent
554c627a58
commit
fba7e12c36
13 changed files with 59 additions and 90 deletions
|
|
@ -21,10 +21,11 @@ export function FilterEditForm({
|
|||
}: FilterEditFormProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const [currentFilters, setCurrentFilters] = useState(filters);
|
||||
const [currentSegment, setCurrentSegment] = useState(null);
|
||||
const [currentSegment, setCurrentSegment] = useState(segmentId);
|
||||
|
||||
const handleReset = () => {
|
||||
setCurrentFilters([]);
|
||||
setCurrentSegment(null);
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
|
|
@ -32,8 +33,8 @@ export function FilterEditForm({
|
|||
onClose?.();
|
||||
};
|
||||
|
||||
const handleSegmentChange = (segment?: { id: string }) => {
|
||||
setCurrentSegment(segment);
|
||||
const handleSegmentChange = (id: string) => {
|
||||
setCurrentSegment(id);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -49,7 +50,7 @@ export function FilterEditForm({
|
|||
<TabPanel id="segments">
|
||||
<SegmentFilters
|
||||
websiteId={websiteId}
|
||||
segmentId={segmentId}
|
||||
segmentId={currentSegment}
|
||||
onSave={handleSegmentChange}
|
||||
/>
|
||||
</TabPanel>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue