fix: only workflow should display start modal (#24623)

This commit is contained in:
非法操作 2025-08-27 16:20:31 +08:00 committed by GitHub
parent 3dae108f84
commit 17908fbf6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -57,17 +57,21 @@ export const useWorkflowInit = () => {
if (error && error.json && !error.bodyUsed && appDetail) {
error.json().then((err: any) => {
if (err.code === 'draft_workflow_not_exist') {
const isAdvancedChat = appDetail.mode === 'advanced-chat'
workflowStore.setState({
notInitialWorkflow: true,
showOnboarding: true,
showOnboarding: !isAdvancedChat,
hasShownOnboarding: false,
})
const nodesData = isAdvancedChat ? nodesTemplate : []
const edgesData = isAdvancedChat ? edgesTemplate : []
syncWorkflowDraft({
url: `/apps/${appDetail.id}/workflows/draft`,
params: {
graph: {
nodes: [],
edges: [],
nodes: nodesData,
edges: edgesData,
},
features: {
retriever_resource: { enabled: true },