From 689d960b5e5e2a0b9fc66cd0a30789ced7926930 Mon Sep 17 00:00:00 2001 From: yauheni-deriv Date: Fri, 30 Aug 2024 11:15:51 +0300 Subject: [PATCH] chore: remove comments --- .../src/App/Components/Elements/LiveChat/use-livechat.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/core/src/App/Components/Elements/LiveChat/use-livechat.ts b/packages/core/src/App/Components/Elements/LiveChat/use-livechat.ts index fbdbf26ff6fb..ca83a5de3b60 100644 --- a/packages/core/src/App/Components/Elements/LiveChat/use-livechat.ts +++ b/packages/core/src/App/Components/Elements/LiveChat/use-livechat.ts @@ -35,8 +35,6 @@ const useLiveChat = (has_cookie_account = false, active_loginid?: string) => { client_first_name = first_name ?? ' '; client_last_name = last_name ?? ' '; - /* the session variables are sent to CS team dashboard to notify user has logged in - and also acts as custom variables to trigger targeted engagement */ const session_variables = { is_logged_in: !!is_logged_in, loginid: loginid ?? ' ', @@ -51,12 +49,9 @@ const useLiveChat = (has_cookie_account = false, active_loginid?: string) => { window.LiveChatWidget?.call('set_session_variables', session_variables); if (is_logged_in) { - // client logged in - // prepfill name and email window.LiveChatWidget?.call('set_customer_email', session_variables.email); window.LiveChatWidget?.call('set_customer_name', `${client_first_name} ${client_last_name}`); - // prefill name and email fields after chat has ended if (window.LC_API?.on_chat_ended) { window.LC_API.on_chat_ended = () => { window.LiveChatWidget?.call('set_customer_email', session_variables.email); @@ -64,11 +59,9 @@ const useLiveChat = (has_cookie_account = false, active_loginid?: string) => { }; } } else { - // client not logged in - // clear name and email fields window.LiveChatWidget?.call('set_customer_email', ' '); window.LiveChatWidget?.call('set_customer_name', ' '); - // clear name and email fields after chat has ended + if (window.LC_API?.on_chat_ended) { window.LC_API.on_chat_ended = () => { window.LiveChatWidget?.call('set_customer_email', ' ');