fix: unexpected redirection when landing at workflow (#22932)

This commit is contained in:
KVOJJJin
2025-07-25 08:48:47 +08:00
committed by GitHub
parent d6b980a2dd
commit cff6a488f8
3 changed files with 9 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ import { FeaturesProvider } from '@/app/components/base/features'
import type { Features as FeaturesData } from '@/app/components/base/features/types'
import { FILE_EXTS } from '@/app/components/base/prompt-editor/constants'
import { fetchFileUploadConfig } from '@/service/common'
import { useAppContext } from '@/context/app-context'
import WorkflowWithDefaultContext from '@/app/components/workflow'
import {
WorkflowContextProvider,
@@ -31,6 +32,7 @@ const WorkflowAppWithAdditionalContext = () => {
data,
isLoading,
} = useWorkflowInit()
const { isLoadingCurrentWorkspace, currentWorkspace } = useAppContext()
const { data: fileUploadConfigResponse } = useSWR({ url: '/files/upload' }, fetchFileUploadConfig)
const nodesData = useMemo(() => {
@@ -46,7 +48,7 @@ const WorkflowAppWithAdditionalContext = () => {
return []
}, [data])
if (!data || isLoading) {
if (!data || isLoading || isLoadingCurrentWorkspace || !currentWorkspace.id) {
return (
<div className='relative flex h-full w-full items-center justify-center'>
<Loading />