diff --git a/src/App.jsx b/src/App.jsx index 6d496e7..ed73434 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -589,6 +589,14 @@ export default function App() { } }, [user, userProfile?.username, userProfile?.fullName, userProfile?.avatar, userProfile?.settings?.isPrivate, userProfile?.location]); + // Sync do status público (em tempo real) para a Comunidade + useEffect(() => { + if (user && userStatus) { + const publicProfileDoc = doc(db, 'artifacts', appId, 'publicProfiles', user.uid); + setDoc(publicProfileDoc, { status: userStatus }, { merge: true }).catch(() => {}); + } + }, [user, userStatus]); + // Fetch utilizadores da comunidade useEffect(() => { if (view !== 'community') return; @@ -2569,12 +2577,26 @@ export default function App() { communityUsers.map(u => ( viewCommunityUser(u)}>
-
- {u.avatar ? Avatar : {(u.fullName?.[0] || u.username?.[0] || 'U').toUpperCase()}} +
+
+ {u.avatar ? Avatar : {(u.fullName?.[0] || u.username?.[0] || 'U').toUpperCase()}} +
+

{u.fullName || t('userTitle')}

@{u.username || 'user'}

+ + {t(u.status || 'offline')} +
@@ -2610,6 +2632,18 @@ export default function App() { > + + + {t(selectedCommunityUser.status || 'offline')} +