diff --git a/web/components/kefu/chat-shell.tsx b/web/components/kefu/chat-shell.tsx index bee6d8d..26f8ff0 100644 --- a/web/components/kefu/chat-shell.tsx +++ b/web/components/kefu/chat-shell.tsx @@ -85,7 +85,7 @@ export function KefuChatShell() { useKefuSystemTheme() const messageListRef = useRef(null) - const [isEmbedded] = useState(() => isEmbeddedInHost()) + const [isEmbedded, setIsEmbedded] = useState(false) const [isMaximized, setIsMaximized] = useState(false) const [isCloseDialogOpen, setIsCloseDialogOpen] = useState(false) const [isClosingConversation, setIsClosingConversation] = useState(false) @@ -142,6 +142,10 @@ export function KefuChatShell() { ) const safeMessages = Array.isArray(messages) ? messages : [] + useEffect(() => { + setIsEmbedded(isEmbeddedInHost()) + }, []) + const maybeMarkConversationRead = useCallback(() => { if (!isVisible || !conversation || typeof document === "undefined") { return