From 994ac1e5bf619d5743178015044ff3ef81ca264c Mon Sep 17 00:00:00 2001 From: PhilReact Date: Tue, 1 Apr 2025 21:43:35 +0300 Subject: [PATCH] fixes --- src/hooks/useResourceStatus.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hooks/useResourceStatus.tsx b/src/hooks/useResourceStatus.tsx index 36bc45a..511e074 100644 --- a/src/hooks/useResourceStatus.tsx +++ b/src/hooks/useResourceStatus.tsx @@ -183,5 +183,15 @@ export const useResourceStatus = ({ resource?.service, downloadResource, ]); - return !status ? null : {...(status || {}), isReady: status?.status === 'READY'}; + + const resourceUrl = resource ? `/arbitrary/${resource.service}/${resource.name}/${resource.identifier}` : null; + + return { + status: status?.status || "SEARCHING", + localChunkCount: status?.localChunkCount || 0, + totalChunkCount: status?.totalChunkCount || 0, + percentLoaded: status?.percentLoaded || 0, + isReady: status?.status === 'READY', + resourceUrl, + }; };