diff --git a/apps/scandic-web/components/ChatbotScript/Client.tsx b/apps/scandic-web/components/ChatbotScript/Client.tsx index 5ca247c35..ab4f0327f 100644 --- a/apps/scandic-web/components/ChatbotScript/Client.tsx +++ b/apps/scandic-web/components/ChatbotScript/Client.tsx @@ -4,7 +4,10 @@ import { usePathname, useSearchParams } from "next/navigation" import Script from "next/script" import { useEffect } from "react" -import { shouldShowChatbot } from "@/components/ChatbotScript/utils" +import { + getChatbotKey, + shouldShowChatbot, +} from "@/components/ChatbotScript/utils" import useLang from "@/hooks/useLang" interface ChatbotClientProps { @@ -15,10 +18,9 @@ export function ChatbotClient({ liveLangs }: ChatbotClientProps) { const lang = useLang() const pathname = usePathname() const searchParams = useSearchParams() - const currentLang = useLang() - const isLive = liveLangs.includes(currentLang) - const shouldShow = - isLive && shouldShowChatbot(pathname, searchParams, currentLang) + const isLive = liveLangs.includes(lang) + const shouldShow = isLive && shouldShowChatbot(pathname, searchParams, lang) + const chatbotKey = getChatbotKey(lang) useEffect(() => { window.kindlyOptions = { @@ -53,7 +55,7 @@ export function ChatbotClient({ liveLangs }: ChatbotClientProps) {