fix: intercom zindex (#24096)

This commit is contained in:
Amit Sharma authored and GitHub committed 2025-09-29 11:43:11 -03:00
1 parent e6b2116a2b
commit dbd927c002
5 files changed
+23 -21

No files matched your search

@@ -1,4 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import { noop } from "lodash";
import { useEffect } from "react";
import type { IntercomBootProps, IntercomProps } from "react-use-intercom";
@@ -13,7 +13,7 @@ import useMediaQuery from "@calcom/lib/hooks/useMediaQuery";
import { localStorage } from "@calcom/lib/webstorage";
import { trpc } from "@calcom/trpc/react";
// eslint-disable-next-line turbo/no-undeclared-env-vars
export const isInterComEnabled = z.string().min(1).safeParse(process.env.NEXT_PUBLIC_INTERCOM_APP_ID).success;
const useIntercomHook = isInterComEnabled
@@ -57,6 +57,7 @@ export const useIntercom = () => {
...(data && data?.email && { email: data.email }),
...(data && data?.id && { userId: data.id }),
createdAt: String(dayjs(data?.createdDate).unix()),
zIndex: 10,
...(userHash && { userHash }),
hideDefaultLauncher: isMobile,
customAttributes: {
@@ -104,6 +105,7 @@ export const useIntercom = () => {
createdAt: String(dayjs(data?.createdDate).unix()),
...(userHash && { userHash }),
hideDefaultLauncher: isMobile,
zIndex: 10,
customAttributes: {
//keys should be snake cased
user_name: data?.username,
@@ -183,7 +185,6 @@ export const useBootIntercom = () => {
};
window.dispatchEvent(new Event("support:ready"));
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [user, statsData, hasPaidPlan, isTieredSupportEnabled]);
};