diff --git a/src/components/dialogs/autoImportDialog/component.tsx b/src/components/dialogs/autoImportDialog/component.tsx index 39a7f50f..cf0e9862 100644 --- a/src/components/dialogs/autoImportDialog/component.tsx +++ b/src/components/dialogs/autoImportDialog/component.tsx @@ -48,9 +48,9 @@ class AutoImportDialog extends React.Component< for (const item of items) { const fullPath = path.join(dirPath, item); const stat = fs.statSync(fullPath); - if (stat.isDirectory && !stat.isFile()) { + if (stat.isDirectory && !stat.isFile) { files = files.concat(this.getAllFilesRecursively(fs, path, fullPath)); - } else if (stat.isFile()) { + } else if (stat.isFile) { const ext = path.extname(item).toLowerCase(); if (supportedFormats.includes(ext)) { files.push(fullPath); diff --git a/src/components/importLocal/component.tsx b/src/components/importLocal/component.tsx index 770f9803..2d05b417 100644 --- a/src/components/importLocal/component.tsx +++ b/src/components/importLocal/component.tsx @@ -646,9 +646,9 @@ class ImportLocal extends React.Component { for (const item of items) { const fullPath = path.join(dirPath, item); const stat = fs.statSync(fullPath); - if (stat.isDirectory && !stat.isFile()) { + if (stat.isDirectory && !stat.isFile) { result = result.concat(getAllFiles(fullPath)); - } else if (stat.isFile()) { + } else if (stat.isFile) { const ext = path.extname(item).toLowerCase(); if (supportedFormats.includes(ext)) { result.push(fullPath);