🐛(frontend) prevent Crisp crash when superuser has no email

Fix crash when switching from admin session to app with superuser account
that lacks email field. Add null check to prevent Crisp initialization
errors.
This commit is contained in:
lebaudantoine
2025-07-20 17:55:38 +02:00
parent de6b8e1e22
commit 6593e449e2
@@ -7,7 +7,7 @@ export const initializeSupportSession = (user: ApiUser) => {
if (!Crisp.isCrispInjected()) return
const { id, email } = user
Crisp.setTokenId(`meet-${id}`)
Crisp.user.setEmail(email)
if (email) Crisp.user.setEmail(email)
}
export const terminateSupportSession = () => {