Sfoglia il codice sorgente

friends screen fix

Viktoriia 1 giorno fa
parent
commit
f82dff3cb4

+ 4 - 1
src/screens/InAppScreens/ProfileScreen/MyFriendsScreen/index.tsx

@@ -140,11 +140,13 @@ const MyFriendsScreen: FC<Props> = ({ navigation }) => {
   };
 
   const applySort = async () => {
+    const resetPage = 0;
+
     await getMyFriends(
       {
         token,
         type: routes[index].key,
-        page,
+        page: resetPage,
         sort: filter.ranking,
         age: filter.age,
         country: filter.country
@@ -159,6 +161,7 @@ const MyFriendsScreen: FC<Props> = ({ navigation }) => {
           });
           setMaxPages(data[routes[index].key].max_pages);
           setMasterCountries(convertData(data[routes[index].key].countries) ?? []);
+          setPage(resetPage);
           setLoading(false);
         }
       }