find a crash
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 19s

This commit is contained in:
Mylloon 2024-10-14 22:24:12 +02:00
parent 3a00874ce0
commit ae3b7a2c0d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -25,6 +25,7 @@ export const handleAttachements = (
files.forEach((file, idx) => {
const fieldValue = currentField.length > 0 ? `${currentField}, ${file}` : file;
// TODO: There is a bug when there is ONE field, it crashes
if (fieldValue.length > maxFieldValueLength || idx === files.length - 1) {
multiple = multiple === 0 && idx !== files.length - 1 ? 1 : multiple + 1;
fields.push({