🐛(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
committed by aleb_the_flash
parent 04081f04fc
commit 26d668b478

View File

@@ -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 = () => {