From 5a357f0aa0cacf39440988c8d75ebc9c90a64176 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Mon, 29 Jun 2026 09:41:48 -0700 Subject: [PATCH] Add Last Synced date and time to friend profile --- index.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 46719ff..4d526e2 100644 --- a/index.html +++ b/index.html @@ -529,10 +529,14 @@ Display Name — -
+
Date Joined —
+
+ Last Synced + — +
@@ -1218,6 +1222,16 @@ window.openFriendProfile = async function(uid) { const addedAt = friendsData[uid]?.addedAt?.toDate?.(); document.getElementById('fp-joined').textContent = addedAt ? addedAt.toLocaleDateString('en-US', {month:'long', day:'numeric', year:'numeric'}) : '—'; + try { + const stepsDoc = await getDoc(doc(db, 'steps', uid)); + const syncTs = stepsDoc.data()?.lastSynced?.toDate?.(); + document.getElementById('fp-last-synced').textContent = syncTs + ? syncTs.toLocaleString('en-US', {month:'short', day:'numeric', year:'numeric', hour:'numeric', minute:'2-digit'}) + : 'Never'; + } catch(e) { + document.getElementById('fp-last-synced').textContent = 'Never'; + } + showScreen('friend-profile'); }