From ec34dc8f537b5c3e957661833f12567bf7d6403d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 23 Jun 2022 14:50:58 +0100 Subject: [PATCH] fix algo list fetching * closes #1537 * addresses #1538 --- src/@utils/compute.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/@utils/compute.ts b/src/@utils/compute.ts index b7c5e5d9f..a4967a014 100644 --- a/src/@utils/compute.ts +++ b/src/@utils/compute.ts @@ -177,16 +177,15 @@ export async function getAlgorithmsForAsset( const publisherTrustedAlgorithms = computeService.compute.publisherTrustedAlgorithms || [] - let algorithms: Asset[] - if (!computeService.compute) { - algorithms = [] - } else { - const gueryResults = await queryMetadata( - getQueryString(publisherTrustedAlgorithms, asset.chainId), - token - ) - algorithms = gueryResults?.results + if (!computeService.compute || publisherTrustedAlgorithms.length === 0) { + return [] } + + const gueryResults = await queryMetadata( + getQueryString(publisherTrustedAlgorithms, asset.chainId), + token + ) + const algorithms: Asset[] = gueryResults?.results return algorithms }