From 883f58e2280025fa7e7e454c662b3ab083c06e7d Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Sat, 20 Jun 2026 23:24:53 -0700 Subject: [PATCH] Load profiles for pending friends so name shows in friend requests --- index.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.html b/index.html index a3ddde4..075db38 100644 --- a/index.html +++ b/index.html @@ -917,7 +917,16 @@ function loadFriendsRealtime() { const approvedUids = Object.entries(friendsData) .filter(([uid, data]) => data.approved === true && data.enabled === true) .map(([uid]) => uid); + const pendingUids = Object.entries(friendsData) + .filter(([uid, data]) => data.approved === false && data.enabled !== false) + .map(([uid]) => uid); await loadFriendProfilesAndSteps(approvedUids); + for (const uid of pendingUids) { + if (!friendProfiles[uid]) { + const pSnap = await getDoc(doc(db, 'profiles', uid)); + friendProfiles[uid] = pSnap.exists() ? pSnap.data() : {}; + } + } renderLeaderboard(); renderPendingRequests(); renderManageFriends();