Typescript, Compose: use forEach

This commit is contained in:
Alex Gleason 2022-02-28 14:13:40 -06:00
parent 3a5c62cb70
commit d72ef7b423
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 3 deletions

View File

@ -310,8 +310,8 @@ export function uploadCompose(files) {
dispatch(uploadComposeRequest());
for (const [i, f] of Array.from(files).entries()) {
if (media.size + i > attachmentLimit - 1) break;
Array.from(files).forEach((f, i) => {
if (media.size + i > attachmentLimit - 1) return;
// FIXME: Don't define function in loop
/* eslint-disable no-loop-func */
@ -348,7 +348,7 @@ export function uploadCompose(files) {
});
}).catch(error => dispatch(uploadComposeFail(error)));
/* eslint-enable no-loop-func */
}
});
};
}