hydration fix
This commit is contained in:
parent
231b65dc32
commit
00f7b5b086
@ -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' ||
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user