Skip to content

Commit

Permalink
fix(useVotedRepos.tsx): catch null fetchRecommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanjpg committed Jan 5, 2024
1 parent a468e18 commit 865e609
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hooks/useVotedRepos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const useVotedRepos = () => {
if (user) {
const data = await fetchRecommendations("myVotes", 1000, user, "");

if(!data) {

Check failure on line 16 in src/hooks/useVotedRepos.ts

View workflow job for this annotation

GitHub Actions / Code standards

Expected space(s) after "if"

Check failure on line 16 in src/hooks/useVotedRepos.ts

View workflow job for this annotation

GitHub Actions / Code standards

Expected space(s) after "if"
return setVotedReposIds([]);
}

return setVotedReposIds(data.map(({ id }) => id));
}
} catch (e) {
Expand Down

0 comments on commit 865e609

Please sign in to comment.