hydration fix

This commit is contained in:
seaznCode 2026-01-13 19:03:21 +01:00
parent 231b65dc32
commit 00f7b5b086

View File

@ -263,9 +263,8 @@ export default function Header({ setGlobalLoggingOut }: HeaderProps) {
const isLoggedIn = !!user const isLoggedIn = !!user
const userPresent = mounted && isLoggedIn const userPresent = mounted && isLoggedIn
// NEW: detect admin role across common shapes, but only after mount // NEW: detect admin role across common shapes (guarded by mount to avoid SSR/CSR mismatch)
const isAdmin = const rawIsAdmin =
mounted &&
!!user && !!user &&
( (
(user as any)?.role === 'admin' || (user as any)?.role === 'admin' ||