mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 03:09:01 +08:00
[fix] support feature restore (#12563)
This commit is contained in:
parent
1859d57784
commit
b4873ecb43
@ -760,7 +760,21 @@ export const useWorkflowRun = () => {
|
|||||||
edges,
|
edges,
|
||||||
viewport,
|
viewport,
|
||||||
})
|
})
|
||||||
featuresStore?.setState({ features: publishedWorkflow.features })
|
const mappedFeatures = {
|
||||||
|
opening: {
|
||||||
|
enabled: !!publishedWorkflow.features.opening_statement || !!publishedWorkflow.features.suggested_questions.length,
|
||||||
|
opening_statement: publishedWorkflow.features.opening_statement,
|
||||||
|
suggested_questions: publishedWorkflow.features.suggested_questions,
|
||||||
|
},
|
||||||
|
suggested: publishedWorkflow.features.suggested_questions_after_answer,
|
||||||
|
text2speech: publishedWorkflow.features.text_to_speech,
|
||||||
|
speech2text: publishedWorkflow.features.speech_to_text,
|
||||||
|
citation: publishedWorkflow.features.retriever_resource,
|
||||||
|
moderation: publishedWorkflow.features.sensitive_word_avoidance,
|
||||||
|
file: publishedWorkflow.features.file_upload,
|
||||||
|
}
|
||||||
|
|
||||||
|
featuresStore?.setState({ features: mappedFeatures })
|
||||||
workflowStore.getState().setPublishedAt(publishedWorkflow.created_at)
|
workflowStore.getState().setPublishedAt(publishedWorkflow.created_at)
|
||||||
workflowStore.getState().setEnvironmentVariables(publishedWorkflow.environment_variables || [])
|
workflowStore.getState().setEnvironmentVariables(publishedWorkflow.environment_variables || [])
|
||||||
}, [featuresStore, handleUpdateWorkflowCanvas, workflowStore])
|
}, [featuresStore, handleUpdateWorkflowCanvas, workflowStore])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user