From de519f496924f12970031389fabdbc8368b22932 Mon Sep 17 00:00:00 2001 From: Norbi <37236152+KatunaNorbert@users.noreply.github.com> Date: Thu, 15 Jul 2021 17:46:14 +0300 Subject: [PATCH] Fix datasets algorithm is allowed to run on returning nothing (#738) --- .../AssetContent/AlgorithmDatasetsListForCompute.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/AssetContent/AlgorithmDatasetsListForCompute.tsx b/src/components/organisms/AssetContent/AlgorithmDatasetsListForCompute.tsx index 09c2f15d8..ab5c2516a 100644 --- a/src/components/organisms/AssetContent/AlgorithmDatasetsListForCompute.tsx +++ b/src/components/organisms/AssetContent/AlgorithmDatasetsListForCompute.tsx @@ -21,7 +21,10 @@ export default function AlgorithmDatasetsListForCompute({ useEffect(() => { async function getDatasetsAllowedForCompute() { - const datasetComputeService = dataset.findServiceByType('compute') + const isCompute = Boolean(dataset?.findServiceByType('compute')) + const datasetComputeService = dataset.findServiceByType( + isCompute ? 'compute' : 'access' + ) const datasets = await getAlgorithmDatasetsForCompute( algorithmDid, datasetComputeService?.serviceEndpoint,