Skip to content

Commit

Permalink
fix infinite requests try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Shushunya committed Nov 29, 2023
1 parent 79537d5 commit 5ea3b7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FrontEnd/src/components/profileList/ProfileListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function ProfileListPage({ isAuthorized }) {
useEffect(() => {
setProfileFilter(FILTER_MAP[filter]);
setFilterSaved(false);
}, [filter]);
}, [filter, filterSaved]);

const urlForAll = `${process.env.REACT_APP_BASE_API_URL}/api/profiles/?${profileFilter}&page=${currentPage}`;

Expand All @@ -46,7 +46,7 @@ export default function ProfileListPage({ isAuthorized }) {
data: fetchedProfiles,
error,
isLoading,
} = useSWR(filterSaved ? urlForSaved : urlForAll, fetcher, {revalidateOnFocus: false});
} = useSWR(filterSaved ? urlForSaved : urlForAll, fetcher, {revalidateIfStale: false});

const handleRadioSelect = () => {
if (!filterSaved) {
Expand Down

0 comments on commit 5ea3b7e

Please sign in to comment.