fix: user undefined (#9022)

pull/9010/head^2
Nafees Nazik 2023-05-23 04:32:54 +05:30 committed by GitHub
parent 5cc530593b
commit 81e57afcf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -35,9 +35,9 @@ export const useIntercom = () => {
}
hookData.boot({
name: data?.name ?? "",
email: data?.email,
userId: String(data?.id),
...(data && data?.name && { name: data.name }),
...(data && data?.email && { email: data.email }),
...(data && data?.id && { userId: data.id }),
createdAt: String(dayjs(data?.createdDate).unix()),
...(userHash && { userHash }),
customAttributes: {
@ -50,6 +50,7 @@ export const useIntercom = () => {
has_paid_plan: hasPaidPlan,
has_team_plan: hasTeamPlan,
metadata: data?.metadata,
is_logged_in: !!data,
},
});
hookData.show();