Skip to content

Commit

Permalink
Merge branch 'fix/compatible-with-outputs-data-structure' into deploy…
Browse files Browse the repository at this point in the history
…/dev
  • Loading branch information
JzoNgKVO committed Dec 6, 2024
2 parents 83e83d7 + d9f262c commit 4e7d374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/app/components/base/file-uploader/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ export const isAllowedFileExtension = (fileName: string, fileMimetype: string, a

export const getFilesInLogs = (rawData: any) => {
const result = Object.keys(rawData || {}).map((key) => {
if (typeof rawData[key] === 'object' && rawData[key].dify_model_identity === '__dify__file__') {
if (typeof rawData[key] === 'object' && rawData[key]?.dify_model_identity === '__dify__file__') {
return {
varName: key,
list: getProcessedFilesFromResponse([rawData[key]]),
}
}
if (Array.isArray(rawData[key]) && rawData[key].some(item => item.dify_model_identity === '__dify__file__')) {
if (Array.isArray(rawData[key]) && rawData[key].some(item => item?.dify_model_identity === '__dify__file__')) {
return {
varName: key,
list: getProcessedFilesFromResponse(rawData[key]),
Expand Down
4 changes: 2 additions & 2 deletions web/app/components/workflow/run/output-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const OutputPanel: FC<OutputPanelProps> = ({
for (const key in outputs) {
if (Array.isArray(outputs[key])) {
outputs[key].map((output: any) => {
if (output.dify_model_identity === '__dify__file__')
if (output?.dify_model_identity === '__dify__file__')
fileList.push(output)
return null
})
}
else if (outputs[key].dify_model_identity === '__dify__file__') {
else if (outputs[key]?.dify_model_identity === '__dify__file__') {
fileList.push(outputs[key])
}
}
Expand Down

0 comments on commit 4e7d374

Please sign in to comment.