diff --git a/app/components/lib/uppy.ts b/app/components/lib/uppy.ts index acb9715..b342ea7 100644 --- a/app/components/lib/uppy.ts +++ b/app/components/lib/uppy.ts @@ -16,6 +16,7 @@ import { useSdk } from "~/components/lib/sdk-context"; import UppyFileUpload from "~/components/lib/uppy-file-upload"; import { PROTOCOL_S5, type Sdk } from "@lumeweb/portal-sdk"; import type { S5Client, HashProgressEvent } from "@lumeweb/s5-js"; +import { useInvalidate } from "@refinedev/core"; const LISTENING_EVENTS = [ "upload", @@ -27,6 +28,7 @@ const LISTENING_EVENTS = [ ] as const; export function useUppy() { + const invalidate = useInvalidate() const sdk = useSdk(); const [uploadLimit, setUploadLimit] = useState(0); @@ -200,6 +202,10 @@ export function useUppy() { console.log("successful files:", result.successful); console.log("failed files:", result.failed); setFailedFiles(result.failed); + invalidate({ + resource: "file", + invalidates: ["list"] + }) }); const setStateCb = (event: (typeof LISTENING_EVENTS)[number]) => { diff --git a/app/providers/PinningProvider.tsx b/app/providers/PinningProvider.tsx index f4d3bf8..8c9b363 100644 --- a/app/providers/PinningProvider.tsx +++ b/app/providers/PinningProvider.tsx @@ -59,7 +59,7 @@ export const PinningProvider = ({ children }: React.PropsWithChildren) => { ) { const hasCompletedItems = queryResult.data.items.some(item => item.status === 'completed'); if (hasCompletedItems) { - invalidate({ resource: "files", invalidates: ["list"] }); + invalidate({ resource: "file", invalidates: ["list"] }); } } }, [