Typescript, Compose: use forEach
This commit is contained in:
parent
3a5c62cb70
commit
d72ef7b423
|
@ -310,8 +310,8 @@ export function uploadCompose(files) {
|
||||||
|
|
||||||
dispatch(uploadComposeRequest());
|
dispatch(uploadComposeRequest());
|
||||||
|
|
||||||
for (const [i, f] of Array.from(files).entries()) {
|
Array.from(files).forEach((f, i) => {
|
||||||
if (media.size + i > attachmentLimit - 1) break;
|
if (media.size + i > attachmentLimit - 1) return;
|
||||||
|
|
||||||
// FIXME: Don't define function in loop
|
// FIXME: Don't define function in loop
|
||||||
/* eslint-disable no-loop-func */
|
/* eslint-disable no-loop-func */
|
||||||
|
@ -348,7 +348,7 @@ export function uploadCompose(files) {
|
||||||
});
|
});
|
||||||
}).catch(error => dispatch(uploadComposeFail(error)));
|
}).catch(error => dispatch(uploadComposeFail(error)));
|
||||||
/* eslint-enable no-loop-func */
|
/* eslint-enable no-loop-func */
|
||||||
}
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue