fix: Resolve error when checking pipeline parsing result (#15778)

### What problem does this PR solve?

fix: Resolve error when checking pipeline parsing result

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2026-06-08 19:16:21 +08:00
committed by GitHub
parent d9a04ef702
commit 7dd4030986
2 changed files with 3 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { memo } from 'react';
import { Images } from '@/constants/common';
import CSVFileViewer from './csv-preview';
import { DocPreviewer } from './doc-preview';
import { ExcelCsvPreviewer } from './excel-preview';
@@ -44,9 +45,7 @@ const DocumentPreview = function ({
<TxtPreviewer className={className} url={url} />
</section>
)}
{['jpg', 'png', 'gif', 'jpeg', 'svg', 'bmp', 'ico', 'tif'].indexOf(
fileType,
) > -1 && (
{Images.indexOf(fileType) > -1 && (
<section>
<ImagePreviewer className={className} url={url} />
</section>

View File

@@ -63,7 +63,7 @@ const DataflowResult = () => {
const fileType = useMemo(() => {
if (isAgent) {
return Images.some((x) => x === documentExtension)
? documentInfo?.name.split('.').pop() || 'visual'
? documentInfo?.name?.split('.').pop() || documentExtension
: documentExtension;
}
switch (documentInfo?.type) {