mirror of
https://github.com/langgenius/dify.git
synced 2026-04-23 12:16:11 +08:00
fix: click tool not show current
This commit is contained in:
@ -333,6 +333,8 @@ const ToolBlockComponent: FC<ToolBlockComponentProps> = ({
|
||||
onMouseDown={() => {
|
||||
if (!currentProvider || !currentTool)
|
||||
return
|
||||
if (configuredToolValue)
|
||||
setToolValue(configuredToolValue)
|
||||
setIsSettingOpen(true)
|
||||
}}
|
||||
>
|
||||
|
||||
@ -78,7 +78,21 @@ const SkillDocEditor: FC = () => {
|
||||
return
|
||||
if (dirtyMetadataIds.has(activeTabId))
|
||||
return
|
||||
storeApi.getState().setFileMetadata(activeTabId, fileContent.metadata ?? {})
|
||||
let nextMetadata: Record<string, any> = {}
|
||||
if (fileContent.metadata) {
|
||||
if (typeof fileContent.metadata === 'string') {
|
||||
try {
|
||||
nextMetadata = JSON.parse(fileContent.metadata)
|
||||
}
|
||||
catch {
|
||||
nextMetadata = {}
|
||||
}
|
||||
}
|
||||
else {
|
||||
nextMetadata = fileContent.metadata
|
||||
}
|
||||
}
|
||||
storeApi.getState().setFileMetadata(activeTabId, nextMetadata)
|
||||
storeApi.getState().clearDraftMetadata(activeTabId)
|
||||
}, [activeTabId, dirtyMetadataIds, fileContent, storeApi])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user