fix(striker-ui): adapt axios progress event change

This commit is contained in:
Tsu-ba-me 2024-05-07 14:56:01 -04:00
parent 4c2bf4dbed
commit 237e647cf3

View File

@ -92,7 +92,12 @@ const AddFileForm: FC<AddFileFormProps> = (props) => {
(
fileUuid: string,
): AxiosRequestConfig<FormData>['onUploadProgress'] =>
({ loaded, total }) => {
(progressEvent) => {
// Make the ratio 1 when total isn't available; the upload
// limit will prevent progress from reaching 100 until the
// request completes.
const { loaded, total = loaded } = progressEvent;
setUploads((previous) =>
setUploadProgress(
previous,