Skip to content

Scheduling infrastructure for absolutely everyone.

remove yarnlock (#18377)

Nizzyb48d0e1f48a3
diff --git a/apps/web/lib/plain/plainChat.tsx b/apps/web/lib/plain/plainChat.tsx
index bb28a5508a6..f63b93f0d8e 100644
--- a/apps/web/lib/plain/plainChat.tsx
+++ b/apps/web/lib/plain/plainChat.tsx
@@ -70,11 +70,23 @@ interface PlainChatConfig {
const PlainChat = () => {
const [config, setConfig] = useState<PlainChatConfig | null>(null);
+ const [isSmallScreen, setIsSmallScreen] = useState(false);
const { data: session } = useSession();
const pathname = usePathname();
const searchParams = useSearchParams();
+ const isAppDomain = typeof window !== "undefined" && window.location.hostname === "app.cal.com";
+
useEffect(() => {
+ if (!isAppDomain) return;
+
+ const checkScreenSize = () => {
+ setIsSmallScreen(window.innerWidth < 768);
+ };
+
+ checkScreenSize();
+ window.addEventListener("resize", checkScreenSize);
+
const initConfig = async () => {
if (!session?.user?.email) return;
@@ -211,7 +223,9 @@ const PlainChat = () => {
};
initConfig();
- }, [session, pathname, searchParams]);
+
+ return () => window.removeEventListener("resize", checkScreenSize);
+ }, [session, pathname, searchParams, isAppDomain]);
const plainChatScript = `
window.plainScriptLoaded = function() {
@@ -225,7 +239,7 @@ const PlainChat = () => {
}
`;
- if (!config) return null;
+ if (!isAppDomain || isSmallScreen || !config) return null;
return (
<>