From c9f2d168e7df562290767cd85761ad3216c39972 Mon Sep 17 00:00:00 2001 From: GamerBoss101 Date: Sun, 13 Apr 2025 08:44:42 -0400 Subject: [PATCH] Logout Button --- src/app/(app)/profile/page.tsx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/app/(app)/profile/page.tsx b/src/app/(app)/profile/page.tsx index cbc3598..dcb2dd9 100644 --- a/src/app/(app)/profile/page.tsx +++ b/src/app/(app)/profile/page.tsx @@ -140,11 +140,15 @@ function Mobile() { function handleRemoveFriend(friendCode: string) { // Remove the friend from the friends array and update the state - setFriends((prev: string[]) => prev.filter((friend) => friend !== friendCode)); - + setFriends((prev: string[]) => + prev.filter((friend) => friend !== friendCode) + ); const formData = new FormData(); - formData.append("friends", JSON.stringify(friends.filter((friend: string) => friend !== friendCode))); + formData.append( + "friends", + JSON.stringify(friends.filter((friend: string) => friend !== friendCode)) + ); // Update the user's friends in the database fetch(`/api/me`, { @@ -210,7 +214,7 @@ function Mobile() { - {/* Points and Cosmetics Owned */} + {/* Points and Cosmetics Owned */}

Points & Cosmetics @@ -252,7 +256,11 @@ function Mobile() {
    {friends.length > 0 ? ( friends.map((friendCode: string, index: number) => ( - + )) ) : (

    No friends yet.

    @@ -303,6 +311,10 @@ function Mobile() {

+ + ); }