Skip to content

Commit

Permalink
Remove filter bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leshe4ka committed Apr 24, 2024
1 parent 89d03cc commit 229a2ca
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useTopicDetails } from 'lib/hooks/api/topics';
import EditIcon from 'components/common/Icons/EditIcon';
import CloseIcon from 'components/common/Icons/CloseIcon';
import FlexBox from 'components/common/FlexBox/FlexBox';
import { useMessageFiltersStore } from 'lib/hooks/useMessageFiltersStore';

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

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

const partitions = useMemo(() => {
return (topic?.partitions || []).reduce<{
Expand Down Expand Up @@ -209,7 +211,10 @@ const Filters: React.FC<FiltersProps> = ({
<EditIcon />
</S.EditSmartFilterIcon>
<S.DeleteSmartFilterIcon
onClick={() => setSmartFilter(null)}
onClick={() => {
setSmartFilter(null);
remove(smartFilter.id);
}}
disabled={!!createdEditedSmartId}
>
<CloseIcon />
Expand Down

0 comments on commit 229a2ca

Please sign in to comment.