Skip to content

Commit 1d68e53

Browse files
author
xwj02155382
committed
fix: Modify JS writing style
1 parent 3a702f3 commit 1d68e53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/studio-components/src/ImportFiles/update-file.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ const UploadFile = ({ onChange, accept, title, description, isSaveFiles, onAllCo
2323
try {
2424
if (type === 'application/json') {
2525
const files = await parseJSON(file as File);
26-
onChange?.(files);
26+
if(onChange){
27+
onChange(files);
28+
}
2729
}
2830
if (type === 'text/csv') {
2931
const csvFiles = isSaveFiles ? [file] : [];
3032
const files = await parseCSV(file as File);
31-
onChange?.([files], csvFiles as File[]);
33+
if(onChange){
34+
onChange([files], csvFiles as File[]);
35+
}
3236
}
3337
} catch (error) {
3438
console.error('解析文件失败:', error);

0 commit comments

Comments
 (0)