mirror of
https://github.com/langgenius/dify.git
synced 2026-06-01 06:28:14 +08:00
fix(web): defer try app preview loading
This commit is contained in:
@ -682,7 +682,7 @@ describe('AppList', () => {
|
||||
renderAppList(true, undefined, undefined, { isCloudEdition: true })
|
||||
|
||||
fireEvent.click(getLastByText('explore.appCard.try'))
|
||||
expect(screen.getByTestId('try-app-panel')).toBeInTheDocument()
|
||||
expect(await screen.findByTestId('try-app-panel')).toBeInTheDocument()
|
||||
|
||||
fireEvent.click(screen.getByTestId('try-app-create'))
|
||||
|
||||
@ -705,6 +705,7 @@ describe('AppList', () => {
|
||||
renderAppList(true, undefined, undefined, { isCloudEdition: true })
|
||||
|
||||
fireEvent.click(getLastByText('explore.appCard.try'))
|
||||
await screen.findByTestId('try-app-panel')
|
||||
fireEvent.click(screen.getByTestId('try-app-create'))
|
||||
fireEvent.click(await screen.findByTestId('confirm-create'))
|
||||
|
||||
@ -717,7 +718,8 @@ describe('AppList', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should close try app panel when close is clicked', () => {
|
||||
it('should close try app panel when close is clicked', async () => {
|
||||
vi.useRealTimers()
|
||||
mockExploreData = {
|
||||
categories: ['Writing'],
|
||||
allList: [createApp()],
|
||||
@ -726,7 +728,7 @@ describe('AppList', () => {
|
||||
renderAppList(true, undefined, undefined, { isCloudEdition: true })
|
||||
|
||||
fireEvent.click(getLastByText('explore.appCard.try'))
|
||||
expect(screen.getByTestId('try-app-panel')).toBeInTheDocument()
|
||||
expect(await screen.findByTestId('try-app-panel')).toBeInTheDocument()
|
||||
|
||||
fireEvent.click(screen.getByTestId('try-app-close'))
|
||||
expect(screen.queryByTestId('try-app-panel')).not.toBeInTheDocument()
|
||||
|
||||
@ -18,18 +18,20 @@ import CreateAppModal from '@/app/components/explore/create-app-modal'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
import { useImportDSL } from '@/hooks/use-import-dsl'
|
||||
import { DSLImportMode } from '@/models/app'
|
||||
import dynamic from '@/next/dynamic'
|
||||
import { consoleQuery } from '@/service/client'
|
||||
import { fetchAppDetail } from '@/service/explore'
|
||||
import { systemFeaturesQueryOptions } from '@/service/system-features'
|
||||
import { useMembers } from '@/service/use-common'
|
||||
import { useExploreAppList } from '@/service/use-explore'
|
||||
import { trackCreateApp } from '@/utils/create-app-tracking'
|
||||
import TryApp from '../try-app'
|
||||
import { ExploreAppListHeader } from './explore-app-list-header'
|
||||
import { ExploreRecommendations } from './explore-recommendations'
|
||||
import { ExploreAppListSkeleton, ExploreHeaderSkeleton } from './loading-skeletons'
|
||||
import s from './style.module.css'
|
||||
|
||||
const TryApp = dynamic(() => import('../try-app'), { ssr: false })
|
||||
|
||||
function useHomeContinueWorkApps() {
|
||||
return useQuery(consoleQuery.apps.list.queryOptions({
|
||||
input: {
|
||||
|
||||
Reference in New Issue
Block a user