mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(web): migrate embedded-chatbot header to use isClient utility
Missed migration from the initial refactoring - removes local isClient variable definition and imports from the centralized utility.
This commit is contained in:
@ -11,6 +11,7 @@ import DifyLogo from '@/app/components/base/logo/dify-logo'
|
|||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
import { useGlobalPublicStore } from '@/context/global-public-context'
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
import { isClient } from '@/utils/client'
|
||||||
import {
|
import {
|
||||||
useEmbeddedChatbotContext,
|
useEmbeddedChatbotContext,
|
||||||
} from '../context'
|
} from '../context'
|
||||||
@ -40,7 +41,6 @@ const Header: FC<IHeaderProps> = ({
|
|||||||
allInputsHidden,
|
allInputsHidden,
|
||||||
} = useEmbeddedChatbotContext()
|
} = useEmbeddedChatbotContext()
|
||||||
|
|
||||||
const isClient = typeof window !== 'undefined'
|
|
||||||
const isIframe = isClient ? window.self !== window.top : false
|
const isIframe = isClient ? window.self !== window.top : false
|
||||||
const [parentOrigin, setParentOrigin] = useState('')
|
const [parentOrigin, setParentOrigin] = useState('')
|
||||||
const [showToggleExpandButton, setShowToggleExpandButton] = useState(false)
|
const [showToggleExpandButton, setShowToggleExpandButton] = useState(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user