Skip to content

Commit

Permalink
changed
Browse files Browse the repository at this point in the history
  • Loading branch information
JATIN-RAGHAV committed Jun 5, 2024
1 parent caa32e5 commit ce2ca11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions client/src/components/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ function Users() {
const friendsResponse: FriendsResponse = await getFriends();
const sentFriendRequestResponse: sentFriendRequestsReponse = await getSentFriendRequests();
const receivedFriendRequestsResponse: receivedFriendRequestsResponse = await getReceivedFriendRequests();
usersResponse.Users = usersResponse.Users.filter(user => !friendsResponse.friends.includes(user.username) && !sentFriendRequestResponse.sentFriendRequestsUsername.includes(user.username) && !receivedFriendRequestsResponse.receivedFriendRequestsUsername.includes(user.username))
setUsers(usersResponse.Users)
setIsLoading(false)
if(usersResponse.Users){
usersResponse.Users = usersResponse.Users.filter(user => !friendsResponse.friends.includes(user.username) && !sentFriendRequestResponse.sentFriendRequestsUsername.includes(user.username) && !receivedFriendRequestsResponse.receivedFriendRequestsUsername.includes(user.username))
setUsers(usersResponse.Users)
setIsLoading(false)
}else{ console.dir(usersResponse) }
}
getAndSetUsers();
}, []);
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chattin App</title>
<script type="module" crossorigin src="/assets/index-BvdSJbYF.js"></script>
<script type="module" crossorigin src="/assets/index-C4JDiitt.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down

0 comments on commit ce2ca11

Please sign in to comment.