diff --git a/frontend/app/user/[id]/page.tsx b/frontend/app/user/[id]/page.tsx index a424cd66..22eba42b 100644 --- a/frontend/app/user/[id]/page.tsx +++ b/frontend/app/user/[id]/page.tsx @@ -38,8 +38,10 @@ export default async function FindUser({ const hasSentRequest = requests.requesting.some((r) => r.id === userId); const hasReceivedRequest = requests.requestedBy.some((r) => r.id === userId); const isFriend = myFriends.some((f) => f.id == userId); - const canAddFriend = !hasSentRequest && !hasReceivedRequest && !isFriend; const isBlocking = blockingUsers.some((b) => b.id === userId); + const canAddFriend = + !hasSentRequest && !hasReceivedRequest && !isFriend && !isBlocking; + const canAcceptFriend = hasReceivedRequest && !isFriend && !isBlocking; // TODO: Must consider these situations // 1. Already friends // 2. Friend request sent @@ -58,7 +60,7 @@ export default async function FindUser({ <>
{hasSentRequest && } - {hasReceivedRequest && } + {canAcceptFriend && } {hasReceivedRequest && } {isFriend && } {canAddFriend && }