Skip to content

Commit 229a2ca

Browse files
author
Leshe4ka
committed
Remove filter bugfix.
1 parent 89d03cc commit 229a2ca

File tree

1 file changed

+6
-1
lines changed
  • frontend/src/components/Topics/Topic/Messages/Filters

1 file changed

+6
-1
lines changed

frontend/src/components/Topics/Topic/Messages/Filters/Filters.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useTopicDetails } from 'lib/hooks/api/topics';
1717
import EditIcon from 'components/common/Icons/EditIcon';
1818
import CloseIcon from 'components/common/Icons/CloseIcon';
1919
import FlexBox from 'components/common/FlexBox/FlexBox';
20+
import { useMessageFiltersStore } from 'lib/hooks/useMessageFiltersStore';
2021

2122
import * as S from './Filters.styled';
2223
import {
@@ -66,6 +67,7 @@ const Filters: React.FC<FiltersProps> = ({
6667

6768
const { data: topic } = useTopicDetails({ clusterName, topicName });
6869
const [createdEditedSmartId, setCreatedEditedSmartId] = useState<string>();
70+
const remove = useMessageFiltersStore((state) => state.remove);
6971

7072
const partitions = useMemo(() => {
7173
return (topic?.partitions || []).reduce<{
@@ -209,7 +211,10 @@ const Filters: React.FC<FiltersProps> = ({
209211
<EditIcon />
210212
</S.EditSmartFilterIcon>
211213
<S.DeleteSmartFilterIcon
212-
onClick={() => setSmartFilter(null)}
214+
onClick={() => {
215+
setSmartFilter(null);
216+
remove(smartFilter.id);
217+
}}
213218
disabled={!!createdEditedSmartId}
214219
>
215220
<CloseIcon />

0 commit comments

Comments
 (0)