fix: ensure safe handling of organizations and notifications data in LayoutContent and NotificationCenter components
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user