You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/web/hooks/use-document-title.ts

14 lines
465 B
TypeScript

'use client'
import { useLayoutEffect } from 'react'
import { useGlobalPublicStore } from '@/context/global-public-context'
export default function useDocumentTitle(title: string) {
const { systemFeatures } = useGlobalPublicStore()
useLayoutEffect(() => {
if (systemFeatures.branding.enabled)
document.title = `${title} - ${systemFeatures.branding.application_title}`
else
document.title = `${title} - Dify`
}, [systemFeatures, title])
}