fix: csv select

This commit is contained in:
archer
2023-08-04 18:32:37 +08:00
parent a19c8b9106
commit eb5a252654

View File

@@ -48,7 +48,9 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
setSelecting(true);
try {
let promise = Promise.resolve();
files.forEach((file) => {
files
.filter((file) => /csv$/.test(file.name))
.forEach((file) => {
promise = promise.then(async () => {
const { header, data } = await readCsvContent(file);
if (header[0] !== 'question' || header[1] !== 'answer') {