mirror of https://github.com/langgenius/dify.git
fix: document title error at studio page
This commit is contained in:
parent
74cc4c0ce8
commit
94c64b661e
|
|
@ -29,7 +29,6 @@ import { useStore as useTagStore } from '@/app/components/base/tag-management/st
|
|||
import TagManagementModal from '@/app/components/base/tag-management'
|
||||
import TagFilter from '@/app/components/base/tag-management/filter'
|
||||
import CheckboxWithLabel from '@/app/components/datasets/create/website/base/checkbox-with-label'
|
||||
import useDocumentTitle from '@/hooks/use-document-title'
|
||||
|
||||
const getKey = (
|
||||
pageIndex: number,
|
||||
|
|
@ -128,8 +127,6 @@ const Apps = () => {
|
|||
return () => observer?.disconnect()
|
||||
}, [isLoading, setSize, anchorRef, mutate, data, error])
|
||||
|
||||
useDocumentTitle(isLoading ? '' : t('common.menus.apps'))
|
||||
|
||||
const { run: handleSearch } = useDebounceFn(() => {
|
||||
setSearchKeywords(keywords)
|
||||
}, { wait: 500 })
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
'use client'
|
||||
|
||||
import useDocumentTitle from '@/hooks/use-document-title'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function DatasetsLayout({ children }: { children: React.ReactNode }) {
|
||||
const { t } = useTranslation()
|
||||
useDocumentTitle(t('common.menus.apps'))
|
||||
return (<>
|
||||
{children}
|
||||
</>)
|
||||
}
|
||||
|
|
@ -18,7 +18,6 @@ export const viewport: Viewport = {
|
|||
userScalable: false,
|
||||
}
|
||||
export const metadata: Metadata = {
|
||||
title: ' ',
|
||||
icons: 'data:',
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
import { defaultSystemFeatures } from '@/types/feature'
|
||||
import { renderHook } from '@testing-library/react'
|
||||
import useDocumentTitle from './use-document-title'
|
||||
|
||||
jest.mock('@/context/global-public-context', () => ({
|
||||
useGlobalPublicStore: jest.fn(() => ({ ...defaultSystemFeatures })),
|
||||
}))
|
||||
|
||||
describe('branding.enabled is false', () => {
|
||||
it('document title should be test-Dify if set title', () => {
|
||||
renderHook(() => useDocumentTitle('test'))
|
||||
expect(document.title).toBe('test - Dify')
|
||||
})
|
||||
|
||||
it('document title should be Dify if not set title', () => {
|
||||
renderHook(() => useDocumentTitle(''))
|
||||
expect(document.title).toBe('Dify')
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue