slice descrition when restore workflow

This commit is contained in:
JzoNg 2025-08-12 16:08:28 +08:00 committed by QuantumGhost
parent 53faf90bea
commit 215e318600
1 changed files with 11 additions and 2 deletions

View File

@ -340,8 +340,17 @@ export const useWorkflowRun = () => {
}
featuresStore?.setState({ features: mappedFeatures })
workflowStore.getState().setEnvironmentVariables(publishedWorkflow.environment_variables || [])
workflowStore.getState().setConversationVariables(publishedWorkflow.conversation_variables || [])
// slice description of env & chatVar
const newEnvList = (publishedWorkflow.environment_variables || []).map(env => ({
...env,
description: env.description.slice(0, 256),
}))
const newChatVarList = (publishedWorkflow.conversation_variables || []).map(chatVar => ({
...chatVar,
description: chatVar.description.slice(0, 256),
}))
workflowStore.getState().setEnvironmentVariables(newEnvList || [])
workflowStore.getState().setConversationVariables(newChatVarList || [])
}, [featuresStore, handleUpdateWorkflowCanvas, workflowStore])
return {