Skip to content
4 changes: 3 additions & 1 deletion src/components/ImportSpreadsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ function ImportSpreadsheet({backTo, goTo, isImportingMultiLevelTags}: ImportSpre

const validateFile = (file: FileObject) => {
const {fileExtension} = splitExtensionFromFileName(file?.name ?? '');
if (!CONST.ALLOWED_SPREADSHEET_EXTENSIONS.includes(fileExtension.toLowerCase() as TupleToUnion<typeof CONST.ALLOWED_SPREADSHEET_EXTENSIONS>)) {
const allowedExtensions: readonly string[] = isImportingMultiLevelTags ? CONST.MULTILEVEL_TAG_ALLOWED_SPREADSHEET_EXTENSIONS : CONST.ALLOWED_SPREADSHEET_EXTENSIONS;

if (!allowedExtensions.includes(fileExtension.toLowerCase())) {
setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension');
return false;
}
Expand Down
Loading