From 995f29a8f185650d76452ddf2f860ff5a0065689 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Fri, 20 Dec 2024 19:34:35 +0200 Subject: [PATCH] fix fetch resource --- src/common/useFetchResources.tsx | 10 ++++++++++ src/components/Chat/ChatGroup.tsx | 3 ++- src/components/Embeds/AttachmentEmbed.tsx | 2 +- src/components/Embeds/VideoPlayer.tsx | 1 - 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/useFetchResources.tsx b/src/common/useFetchResources.tsx index a4964ae..04359c0 100644 --- a/src/common/useFetchResources.tsx +++ b/src/common/useFetchResources.tsx @@ -138,6 +138,16 @@ export const useFetchResources = () => { }, })); } + if(res?.status === 'DOWNLOADED'){ + const url = `${getBaseApiReact()}/arbitrary/resource/status/${service}/${name}/${identifier}?build=true`; + const resCall = await fetch(url, { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); + res = await resCall.json(); + } } callFunction() intervalId.current = setInterval(async () => { diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index afcb055..7f02588 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -969,7 +969,8 @@ const clearEditorContent = () => { diff --git a/src/components/Embeds/AttachmentEmbed.tsx b/src/components/Embeds/AttachmentEmbed.tsx index 3de63e3..3480c31 100644 --- a/src/components/Embeds/AttachmentEmbed.tsx +++ b/src/components/Embeds/AttachmentEmbed.tsx @@ -263,7 +263,7 @@ export const AttachmentCard = ({ }}> - {resourceDetails?.status?.status} + {resourceDetails?.status?.status === 'DOWNLOADED' ? 'BUILDING' : resourceDetails?.status?.status} {!resourceDetails && ( <> diff --git a/src/components/Embeds/VideoPlayer.tsx b/src/components/Embeds/VideoPlayer.tsx index 0efa61e..69d31cf 100644 --- a/src/components/Embeds/VideoPlayer.tsx +++ b/src/components/Embeds/VideoPlayer.tsx @@ -440,7 +440,6 @@ export const VideoPlayer: React.FC = ({ } } - console.log('resourceStatus', resourceStatus) return (