fix: user undefined (#9022)

This commit is contained in:
Nafees Nazik
2023-05-22 23:02:54 +00:00
committed by GitHub
parent 5cc530593b
commit 81e57afcf4
@@ -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();