Skip to content

Commit

Permalink
fix: revert passing user data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuzhy-Deriv committed Nov 25, 2024
1 parent 08e67a7 commit 171f772
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/javascript/app/hooks/useInterComChat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { useScript } from 'usehooks-ts';

const useInterComChat = (token, flag, userData) => {
const useInterComChat = (token, flag) => {
const intercom_script = 'https://static.deriv.com/scripts/intercom/v1.0.1.js';
const script_status = useScript(flag ? intercom_script : null);

Expand All @@ -11,7 +11,6 @@ const useInterComChat = (token, flag, userData) => {
window.DerivInterCom.initialize({
token,
hideLauncher: true,
userData,
});
}, [
flag,
Expand Down
8 changes: 1 addition & 7 deletions src/javascript/app/pages/livechat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ const LiveChat = ({ cs_live_chat }) => {
});

const freshChat = useFreshChat(token, isFreshChatEnabled);
const userData = client_data?.email
? {
name : client_data.email.split('@')[0],
email: client_data.email,
}
: null;
useInterComChat(token, isICEnabled, userData);
useInterComChat(token, isICEnabled);

if (!isFreshChatEnabled && !isICEnabled && !cs_live_chat) return null;
getElementById('livechat').style.display =
Expand Down

0 comments on commit 171f772

Please sign in to comment.