Change order of checks for attachments
This commit is contained in:
@@ -1135,14 +1135,6 @@ function preProcessAttachment(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const limitKb = getMaximumAttachmentSizeInKb(getRemoteConfigValue);
|
|
||||||
if (file.size / KIBIBYTE > limitKb) {
|
|
||||||
return {
|
|
||||||
toastType: ToastType.FileSize,
|
|
||||||
parameters: getRenderDetailsForLimit(limitKb),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isFileDangerous(file.name)) {
|
if (isFileDangerous(file.name)) {
|
||||||
return { toastType: ToastType.DangerousFileType };
|
return { toastType: ToastType.DangerousFileType };
|
||||||
}
|
}
|
||||||
@@ -1171,6 +1163,16 @@ function preProcessAttachment(
|
|||||||
return { toastType: ToastType.CannotMixMultiAndNonMultiAttachments };
|
return { toastType: ToastType.CannotMixMultiAndNonMultiAttachments };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Putting this after everything else because the other checks are more
|
||||||
|
// important to show to the user.
|
||||||
|
const limitKb = getMaximumAttachmentSizeInKb(getRemoteConfigValue);
|
||||||
|
if (file.size / KIBIBYTE > limitKb) {
|
||||||
|
return {
|
||||||
|
toastType: ToastType.FileSize,
|
||||||
|
parameters: getRenderDetailsForLimit(limitKb),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user