fix: ensure safe handling of organizations and notifications data in LayoutContent and NotificationCenter components

This commit is contained in:
Usman Baig
2026-02-13 10:01:32 +01:00
parent a389c2a751
commit 4add41293b
3 changed files with 741 additions and 30 deletions

View File

@@ -22,7 +22,7 @@ export default function LayoutContent({ children }: { children: React.ReactNode
useEffect(() => {
if (auth.user) {
getUserOrganizations()
.then((organizations) => setOrgs(organizations))
.then((organizations) => setOrgs(Array.isArray(organizations) ? organizations : []))
.catch(err => console.error('Failed to fetch orgs for header', err))
}
}, [auth.user])