From c0c709e7f5bd197bf049d0c1e5b483de950c5ec4 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 22 Jun 2022 15:12:38 +0100 Subject: [PATCH] effect dependency fixes --- .../AssetActions/Compute/AlgorithmDatasetsListForCompute.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Asset/AssetActions/Compute/AlgorithmDatasetsListForCompute.tsx b/src/components/Asset/AssetActions/Compute/AlgorithmDatasetsListForCompute.tsx index 4243bb642..79a7b24b4 100644 --- a/src/components/Asset/AssetActions/Compute/AlgorithmDatasetsListForCompute.tsx +++ b/src/components/Asset/AssetActions/Compute/AlgorithmDatasetsListForCompute.tsx @@ -5,7 +5,6 @@ import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection' import AssetComputeList from '@shared/AssetList/AssetComputeList' import { useCancelToken } from '@hooks/useCancelToken' import { getServiceByName } from '@utils/ddo' -import { Asset } from '@oceanprotocol/lib' import { AssetExtended } from 'src/@types/AssetExtended' export default function AlgorithmDatasetsListForCompute({ @@ -15,9 +14,9 @@ export default function AlgorithmDatasetsListForCompute({ asset: AssetExtended algorithmDid: string }): ReactElement { + const newCancelToken = useCancelToken() const [datasetsForCompute, setDatasetsForCompute] = useState() - const newCancelToken = useCancelToken() useEffect(() => { if (!asset) return @@ -37,7 +36,7 @@ export default function AlgorithmDatasetsListForCompute({ setDatasetsForCompute(datasets) } asset.metadata.type === 'algorithm' && getDatasetsAllowedForCompute() - }, [asset?.metadata?.type]) + }, [asset, algorithmDid, newCancelToken]) return (