chore: remove chat support component

This commit is contained in:
sriram veeraghanta 2026-03-18 00:13:00 +05:30
parent 72b6453f6f
commit 1faf06c755
4 changed files with 0 additions and 65 deletions

View file

@ -1,49 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useEffect } from "react";
import { Intercom, shutdown, show } from "@intercom/messenger-js-sdk";
import { observer } from "mobx-react";
// custom events
import { CHAT_SUPPORT_EVENTS } from "@/custom-events/chat-support";
// store hooks
import { useInstance } from "@/hooks/store/use-instance";
import { useUser } from "@/hooks/store/user";
const ChatSupportModal = observer(function ChatSupportModal() {
// store hooks
const { data: user } = useUser();
const { config } = useInstance();
// derived values
const intercomAppId = config?.intercom_app_id;
const isEnabled = Boolean(user && config?.is_intercom_enabled && intercomAppId);
useEffect(() => {
if (!isEnabled || !user || !intercomAppId) return;
Intercom({
app_id: intercomAppId,
user_id: user.id,
name: `${user.first_name} ${user.last_name}`,
email: user.email,
hide_default_launcher: true,
});
const handleOpenChatSupport = () => {
show();
};
window.addEventListener(CHAT_SUPPORT_EVENTS.open, handleOpenChatSupport);
return () => {
window.removeEventListener(CHAT_SUPPORT_EVENTS.open, handleOpenChatSupport);
shutdown();
};
}, [user, intercomAppId, isEnabled]);
return null;
});
export default ChatSupportModal;