Commit 93c46d1e by zhaochengxiang

bug fix

parent 14cb0e23
......@@ -36,6 +36,12 @@ const FC = (props) => {
}, [metadataId])
React.useEffect(() => {
if (datasource && (supportedTargetTypes??[]).length > 0) {
setSelectedTargetType(datasource?.type ? datasource?.type : supportedTargetTypes[0].targetType)
}
}, [datasource, supportedTargetTypes])
React.useEffect(() => {
const index = (supportedDatasourceTypies??[]).findIndex(item => item.type === selectedTargetType)
if (index !== -1) {
setDatasourceType(supportedDatasourceTypies[index])
......@@ -57,7 +63,6 @@ const FC = (props) => {
callback: data => {
setLoading(false)
setDatasource(data)
setSelectedTargetType(data?.type)
},
error: () => {
setLoading(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment