Skip to content

Commit f9555c8

Browse files
Unblock home screen rendering
1 parent 44c2d34 commit f9555c8

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

home/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@
524524
currentUser = user;
525525
profile = await ensureProfile(user);
526526
await loadLikedPostIds();
527+
renderProfileCard(0);
527528
updateComposerState();
528529

529530
const profileHref = `../profile/?uid=${encodeURIComponent(user.uid)}`;
@@ -533,10 +534,11 @@
533534
const feedQuery = query(collection(db, "messages"), orderBy("createdAt", "desc"), limit(100));
534535
onSnapshot(feedQuery, async (snap) => {
535536
const items = snap.docs.map((d) => ({ id: d.id, ...d.data() }));
536-
await fetchProfiles([...new Set(items.map((item) => item.authorUid).filter(Boolean))]);
537-
const mentionUsernames = [...new Set(items.flatMap((item) => item.mentions && item.mentions.length ? item.mentions : extractMentions(item.content || "")))];
538-
await fetchMentionProfiles(mentionUsernames);
539537
renderFeed(items);
538+
const authorIds = [...new Set(items.map((item) => item.authorUid).filter(Boolean))];
539+
const mentionUsernames = [...new Set(items.flatMap((item) => item.mentions && item.mentions.length ? item.mentions : extractMentions(item.content || "")))];
540+
fetchProfiles(authorIds).catch(() => {});
541+
fetchMentionProfiles(mentionUsernames).catch(() => {});
540542
}, (error) => { statusEl.textContent = `Feed error: ${error.message}`; });
541543
});
542544

nexnet/home/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@
450450

451451
// Load the posts this user has already liked
452452
await loadLikedPostIds();
453+
renderProfileCard(0);
453454

454455
// ── Real-time Feed (messages collection) ──────────────────────────
455456
const postsQuery = query(
@@ -460,9 +461,7 @@
460461
onSnapshot(postsQuery, async (snapshot) => {
461462
// Fetch live profiles for all authors in one batch
462463
const authorUids = [...new Set(snapshot.docs.map(d => d.data().authorUid).filter(Boolean))];
463-
await fetchProfiles(authorUids);
464464
const mentionUsernames = [...new Set(snapshot.docs.flatMap((d) => d.data().mentions && d.data().mentions.length ? d.data().mentions : extractMentions(d.data().content || '')) )];
465-
await fetchMentionProfiles(mentionUsernames);
466465

467466
const feed = document.getElementById('feed');
468467
feed.innerHTML = '';
@@ -472,6 +471,8 @@
472471
if (snapshot.empty) {
473472
feed.innerHTML = '<p class="text-center text-xs mono pt-8" style="color:var(--text-dim)">No transmissions yet. Be the first.</p>';
474473
}
474+
fetchProfiles(authorUids).catch(() => {});
475+
fetchMentionProfiles(mentionUsernames).catch(() => {});
475476
});
476477
});
477478

0 commit comments

Comments
 (0)