From e8e817554d456137d51f118dab9c848494ac64e2 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Sat, 20 Jun 2026 23:31:39 -0700 Subject: [PATCH] Auto-switch to Friends leaderboard on load when mutual friends exist --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 075db38..4ca4cc7 100644 --- a/index.html +++ b/index.html @@ -908,6 +908,7 @@ window.logManualSteps = async function() { // FRIENDS REALTIME function loadFriendsRealtime() { teardown(); + let firstLoad = true; const myFriendsRef = collection(db, 'friends', currentUser.uid, 'list'); const unsubFriends = onSnapshot(myFriendsRef, async (snap) => { friendsData = {}; @@ -931,6 +932,10 @@ function loadFriendsRealtime() { renderPendingRequests(); renderManageFriends(); updateBadge(); + if (firstLoad) { + firstLoad = false; + if (approvedUids.length > 0) switchPanel('friends'); + } }); unsubscribers.push(unsubFriends);