Change order of checks for attachments
This commit is contained in:
parent
d0df466fbc
commit
7443dd3314
1 changed files with 10 additions and 8 deletions
|
@ -1135,14 +1135,6 @@ function preProcessAttachment(
|
|||
return;
|
||||
}
|
||||
|
||||
const limitKb = getMaximumAttachmentSizeInKb(getRemoteConfigValue);
|
||||
if (file.size / KIBIBYTE > limitKb) {
|
||||
return {
|
||||
toastType: ToastType.FileSize,
|
||||
parameters: getRenderDetailsForLimit(limitKb),
|
||||
};
|
||||
}
|
||||
|
||||
if (isFileDangerous(file.name)) {
|
||||
return { toastType: ToastType.DangerousFileType };
|
||||
}
|
||||
|
@ -1171,6 +1163,16 @@ function preProcessAttachment(
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue