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:
parent
18b487dd75
commit
c0c709e7f5
@ -5,7 +5,6 @@ import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
|||||||
import AssetComputeList from '@shared/AssetList/AssetComputeList'
|
import AssetComputeList from '@shared/AssetList/AssetComputeList'
|
||||||
import { useCancelToken } from '@hooks/useCancelToken'
|
import { useCancelToken } from '@hooks/useCancelToken'
|
||||||
import { getServiceByName } from '@utils/ddo'
|
import { getServiceByName } from '@utils/ddo'
|
||||||
import { Asset } from '@oceanprotocol/lib'
|
|
||||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||||
|
|
||||||
export default function AlgorithmDatasetsListForCompute({
|
export default function AlgorithmDatasetsListForCompute({
|
||||||
@ -15,9 +14,9 @@ export default function AlgorithmDatasetsListForCompute({
|
|||||||
asset: AssetExtended
|
asset: AssetExtended
|
||||||
algorithmDid: string
|
algorithmDid: string
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
|
const newCancelToken = useCancelToken()
|
||||||
const [datasetsForCompute, setDatasetsForCompute] =
|
const [datasetsForCompute, setDatasetsForCompute] =
|
||||||
useState<AssetSelectionAsset[]>()
|
useState<AssetSelectionAsset[]>()
|
||||||
const newCancelToken = useCancelToken()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!asset) return
|
if (!asset) return
|
||||||
@ -37,7 +36,7 @@ export default function AlgorithmDatasetsListForCompute({
|
|||||||
setDatasetsForCompute(datasets)
|
setDatasetsForCompute(datasets)
|
||||||
}
|
}
|
||||||
asset.metadata.type === 'algorithm' && getDatasetsAllowedForCompute()
|
asset.metadata.type === 'algorithm' && getDatasetsAllowedForCompute()
|
||||||
}, [asset?.metadata?.type])
|
}, [asset, algorithmDid, newCancelToken])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.datasetsContainer}>
|
<div className={styles.datasetsContainer}>
|
||||||
|
Loading…
Reference in New Issue
Block a user