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"; import { useInvalidate } from "@refinedev/core";
const LISTENING_EVENTS = [ const LISTENING_EVENTS = [
"upload-progress",
"upload", "upload",
"upload-success", "upload-success",
"upload-error", "upload-error",
@ -208,11 +209,15 @@ export function useUppy() {
const setStateCb = (event: (typeof LISTENING_EVENTS)[number]) => { const setStateCb = (event: (typeof LISTENING_EVENTS)[number]) => {
switch (event) { switch (event) {
case "upload": case "upload":
case "upload-progress":
setState("uploading"); setState("uploading");
break; break;
case "upload-error": case "upload-error":
setState("error"); setState("error");
break; break;
case "upload-success":
setState("completed");
break;
default: default:
break; break;
} }