Skip to content

Commit

Permalink
restart sorting filters
Browse files Browse the repository at this point in the history
  • Loading branch information
unaisdev committed Sep 18, 2023
1 parent d146109 commit 69747d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/screens/profile/components/FilterLists/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {
} from '@app/features/stores/ProfileStore';

import FilterItem from './FilterItem';
import {
SORTED_TYPE_KEYS,
useProfileContext,
} from '@app/containers/ProfileContext';

type Props = {
filterAll: () => void;
Expand All @@ -27,9 +31,11 @@ const FilterLists = ({
}: Props) => {
const {isDarkMode} = useTheme();
const {selectedFilter, setSelectedFilter} = useProfileFiltersStore();
const {setSorted} = useProfileContext();

useEffect(() => {
if (selectedFilter === SELECT_FILTERS.ALL) filterAll();
setSorted(SORTED_TYPE_KEYS.RECENT_ADDED);
}, [selectedFilter]);

const handleTapFilterOwn = () => {
Expand Down

0 comments on commit 69747d8

Please sign in to comment.