1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

effect dependency fixes

This commit is contained in:
Matthias Kretschmann 2022-06-22 15:12:38 +01:00
parent 18b487dd75
commit c0c709e7f5
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -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<AssetSelectionAsset[]>()
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 (
<div className={styles.datasetsContainer}>