From eb38675ded4d4adff9d9cde54855dff717360e10 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 4 Dec 2024 15:06:41 +0100 Subject: [PATCH] fix: apply chat console settings without refreshing the page --- frontend/src/app-components/widget/ChatWidget.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/app-components/widget/ChatWidget.tsx b/frontend/src/app-components/widget/ChatWidget.tsx index f9114c9f..348569fe 100644 --- a/frontend/src/app-components/widget/ChatWidget.tsx +++ b/frontend/src/app-components/widget/ChatWidget.tsx @@ -11,6 +11,7 @@ import UiChatWidget from "hexabot-chat-widget/src/UiChatWidget"; import { usePathname } from "next/navigation"; import { getAvatarSrc } from "@/components/inbox/helpers/mapMessages"; +import { useLoadSettings } from "@/hooks/entities/auth-hooks"; import { useAuth } from "@/hooks/useAuth"; import { useConfig } from "@/hooks/useConfig"; import i18n from "@/i18n/config"; @@ -23,6 +24,11 @@ export const ChatWidget = () => { const { apiUrl } = useConfig(); const { isAuthenticated } = useAuth(); const isVisualEditor = pathname === `/${RouterType.VISUAL_EDITOR}`; + const { data: settings } = useLoadSettings(); + const key = JSON.stringify( + settings?.["console_channel"]?.find((s) => s.label === "allowed_domains") + ?.value, + ); return isAuthenticated ? ( { }} >