瀏覽代碼

friends screen fix

Viktoriia 1 天之前
父節點
當前提交
f82dff3cb4
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/screens/InAppScreens/ProfileScreen/MyFriendsScreen/index.tsx

+ 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);
         }
       }