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

kick in loader earlier

This commit is contained in:
Bogdan Fazakas 2022-05-17 11:20:19 +03:00
parent 4631ae9af7
commit 9a22e92a4a

View File

@ -132,14 +132,12 @@ export default function Compute({
accountId, accountId,
computeEnv computeEnv
) )
console.log('initializedProvider == ', initializedProvider)
setInitializedProviderResponse(initializedProvider) setInitializedProviderResponse(initializedProvider)
if ( if (
asset?.accessDetails?.addressOrId !== ZERO_ADDRESS && asset?.accessDetails?.addressOrId !== ZERO_ADDRESS &&
asset?.accessDetails?.type !== 'free' && asset?.accessDetails?.type !== 'free' &&
initializedProvider.datasets[0].providerFee initializedProvider.datasets[0].providerFee
) { ) {
setIsRequestingDataseOrderPrice(true)
setComputeStatusText( setComputeStatusText(
getComputeFeedback( getComputeFeedback(
asset.accessDetails.baseToken?.symbol, asset.accessDetails.baseToken?.symbol,
@ -169,14 +167,12 @@ export default function Compute({
poolParams, poolParams,
initializedProvider.datasets[0].providerFee initializedProvider.datasets[0].providerFee
) )
console.log('datasetPriceAndFees', datasetPriceAndFees)
if (!datasetPriceAndFees) { if (!datasetPriceAndFees) {
setError('Error setting dataset price and fees!') setError('Error setting dataset price and fees!')
toast.error('Error setting dataset price and fees!') toast.error('Error setting dataset price and fees!')
return return
} }
setDatasetOrderPriceAndFees(datasetPriceAndFees) setDatasetOrderPriceAndFees(datasetPriceAndFees)
setIsRequestingDataseOrderPrice(false)
} }
if ( if (
@ -184,7 +180,6 @@ export default function Compute({
selectedAlgorithmAsset?.accessDetails?.type !== 'free' && selectedAlgorithmAsset?.accessDetails?.type !== 'free' &&
initializedProvider.algorithm.providerFee initializedProvider.algorithm.providerFee
) { ) {
setIsRequestingAlgoOrderPrice(true)
setComputeStatusText( setComputeStatusText(
getComputeFeedback( getComputeFeedback(
selectedAlgorithmAsset?.accessDetails?.baseToken?.symbol, selectedAlgorithmAsset?.accessDetails?.baseToken?.symbol,
@ -227,7 +222,6 @@ export default function Compute({
return return
} }
setAlgoOrderPriceAndFees(algorithmOrderPriceAndFees) setAlgoOrderPriceAndFees(algorithmOrderPriceAndFees)
setIsRequestingAlgoOrderPrice(false)
} }
} }
@ -242,6 +236,7 @@ export default function Compute({
useEffect(() => { useEffect(() => {
if (!selectedAlgorithmAsset?.accessDetails || !accountId) return if (!selectedAlgorithmAsset?.accessDetails || !accountId) return
setIsRequestingAlgoOrderPrice(true)
setIsConsumablePrice(selectedAlgorithmAsset?.accessDetails?.isPurchasable) setIsConsumablePrice(selectedAlgorithmAsset?.accessDetails?.isPurchasable)
// setIsAlgorithmOwned(selectedAlgorithmAsset?.accessDetails?.isOwned) // setIsAlgorithmOwned(selectedAlgorithmAsset?.accessDetails?.isOwned)
setValidAlgorithmOrderTx( setValidAlgorithmOrderTx(
@ -249,9 +244,9 @@ export default function Compute({
) )
async function initSelectedAlgo() { async function initSelectedAlgo() {
console.log('selcted algo', selectedAlgorithmAsset)
await checkAssetDTBalance(selectedAlgorithmAsset) await checkAssetDTBalance(selectedAlgorithmAsset)
await initPriceAndFees() await initPriceAndFees()
setIsRequestingAlgoOrderPrice(false)
} }
initSelectedAlgo() initSelectedAlgo()