From 005cc4c28ef02e6745fd491ed1433530bff0ea23 Mon Sep 17 00:00:00 2001 From: runarvestmann Date: Fri, 13 Dec 2024 10:17:56 +0000 Subject: [PATCH] Auto open livechat if query param present --- .../LiveChatIncChatPanel/LiveChatIncChatPanel.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/components/ChatPanel/LiveChatIncChatPanel/LiveChatIncChatPanel.tsx b/apps/web/components/ChatPanel/LiveChatIncChatPanel/LiveChatIncChatPanel.tsx index 303b4036f181..116fec059775 100644 --- a/apps/web/components/ChatPanel/LiveChatIncChatPanel/LiveChatIncChatPanel.tsx +++ b/apps/web/components/ChatPanel/LiveChatIncChatPanel/LiveChatIncChatPanel.tsx @@ -38,7 +38,12 @@ export const LiveChatIncChatPanel = ({ const n = useNamespace(namespace) useEffect(() => { - if (!hasButtonBeenClicked && !showLauncher) { + const queryParam = new URLSearchParams(window.location.search).get('wa_lid') + if ( + !hasButtonBeenClicked && + !showLauncher && + !(queryParam && ['t10', 't11'].includes(queryParam)) + ) { return () => { // No need for cleanup if we don't initialize widget }