Fix duplicate fml declaration causing syntax error and loading screen freeze
This commit is contained in:
1 parent
f4005b927b
commit
8e00e90d3d
1 file changed
+8
-4
+8
-4
@@ -919,6 +919,7 @@ function loadFriendsRealtime() {
|
|||||||
.map(([uid]) => uid);
|
.map(([uid]) => uid);
|
||||||
await loadFriendProfilesAndSteps(approvedUids);
|
await loadFriendProfilesAndSteps(approvedUids);
|
||||||
renderLeaderboard();
|
renderLeaderboard();
|
||||||
|
renderPendingRequests();
|
||||||
renderManageFriends();
|
renderManageFriends();
|
||||||
updateBadge();
|
updateBadge();
|
||||||
});
|
});
|
||||||
@@ -1004,12 +1005,11 @@ function renderLeaderboard() {
|
|||||||
window.showMoreLb = function() { lbVisibleCount += 10; renderLeaderboard(); }
|
window.showMoreLb = function() { lbVisibleCount += 10; renderLeaderboard(); }
|
||||||
|
|
||||||
// MANAGE FRIENDS
|
// MANAGE FRIENDS
|
||||||
function renderManageFriends() {
|
function renderPendingRequests() {
|
||||||
const fml = document.getElementById('friends-manage-list');
|
|
||||||
if (!fml) return;
|
|
||||||
const pendingUids = getPendingFriendUids();
|
const pendingUids = getPendingFriendUids();
|
||||||
const prSection = document.getElementById('pending-received-section');
|
const prSection = document.getElementById('pending-received-section');
|
||||||
const prList = document.getElementById('pending-received-list');
|
const prList = document.getElementById('pending-received-list');
|
||||||
|
if (!prSection || !prList) return;
|
||||||
if (pendingUids.length > 0) {
|
if (pendingUids.length > 0) {
|
||||||
prSection.style.display = 'block';
|
prSection.style.display = 'block';
|
||||||
prList.innerHTML = pendingUids.map(uid => {
|
prList.innerHTML = pendingUids.map(uid => {
|
||||||
@@ -1029,6 +1029,11 @@ function renderManageFriends() {
|
|||||||
} else {
|
} else {
|
||||||
prSection.style.display = 'none';
|
prSection.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderManageFriends() {
|
||||||
|
const fml = document.getElementById('friends-manage-list');
|
||||||
|
if (!fml) return;
|
||||||
|
|
||||||
const search = (document.getElementById('friends-search')?.value || '').toLowerCase();
|
const search = (document.getElementById('friends-search')?.value || '').toLowerCase();
|
||||||
const mutualUids = getMutualFriendUids();
|
const mutualUids = getMutualFriendUids();
|
||||||
@@ -1041,7 +1046,6 @@ function renderManageFriends() {
|
|||||||
|
|
||||||
filtered.sort((a,b) => (friendsData[b]?.addedAt?.toMillis?.() || 0) - (friendsData[a]?.addedAt?.toMillis?.() || 0));
|
filtered.sort((a,b) => (friendsData[b]?.addedAt?.toMillis?.() || 0) - (friendsData[a]?.addedAt?.toMillis?.() || 0));
|
||||||
|
|
||||||
const fml = document.getElementById('friends-manage-list');
|
|
||||||
if (filtered.length === 0) {
|
if (filtered.length === 0) {
|
||||||
fml.innerHTML = `<div class="empty-state" style="padding:24px 0"><div class="es-icon">🤝</div><h3>${search?'No matches':'No friends yet'}</h3><p>${search?'Try a different search.':'Tap + Invite to add your first StepMate.'}</p></div>`;
|
fml.innerHTML = `<div class="empty-state" style="padding:24px 0"><div class="es-icon">🤝</div><h3>${search?'No matches':'No friends yet'}</h3><p>${search?'Try a different search.':'Tap + Invite to add your first StepMate.'}</p></div>`;
|
||||||
document.getElementById('friends-show-more').style.display = 'none';
|
document.getElementById('friends-show-more').style.display = 'none';
|
||||||
|
|||||||
Reference in new issue
Block a user