From c0f87410c524381be8a19e9c81b6c897997feb20 Mon Sep 17 00:00:00 2001 From: claudiaHash <49017601+claudiaHash@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:49:14 +0200 Subject: [PATCH] No file info shown for valid files (#1029) * get asset file info * additional verification, logs deleted * fixes Co-authored-by: ClaudiaHolhos --- src/components/Asset/AssetActions/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Asset/AssetActions/index.tsx b/src/components/Asset/AssetActions/index.tsx index e9fa66ef5..9cc100d2b 100644 --- a/src/components/Asset/AssetActions/index.tsx +++ b/src/components/Asset/AssetActions/index.tsx @@ -73,14 +73,15 @@ export default function AssetActions({ async function initFileInfo() { setFileIsLoading(true) - - const asset = formikState?.values?.services?.[0].files?.[0].url || ddo.id + const fileUrl = + formikState?.values?.services?.[0].files?.[0].url || + (ddo.metadata?.links ? ddo.metadata?.links[0] : ' ') const providerUrl = formikState?.values?.services[0].providerUrl.url || oceanConfig.providerUri try { - const fileInfoResponse = await getFileInfo(asset, providerUrl) + const fileInfoResponse = await getFileInfo(fileUrl, providerUrl) fileInfoResponse && setFileMetadata(fileInfoResponse[0]) setFileIsLoading(false) } catch (error) {