fix: progress bar not being rendered due to progress not being tracked

This commit is contained in:
Juan Di Toro 2024-03-29 00:14:35 +01:00
parent 6b097e0860
commit a58914a69a
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import type { S5Client, HashProgressEvent } from "@lumeweb/s5-js";
import { useInvalidate } from "@refinedev/core";
const LISTENING_EVENTS = [
"upload-progress",
"upload",
"upload-success",
"upload-error",
@ -208,11 +209,15 @@ export function useUppy() {
const setStateCb = (event: (typeof LISTENING_EVENTS)[number]) => {
switch (event) {
case "upload":
case "upload-progress":
setState("uploading");
break;
case "upload-error":
setState("error");
break;
case "upload-success":
setState("completed");
break;
default:
break;
}