From 6d7852672dea2860490749a4b07db2b77465f1db Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Tue, 17 May 2022 11:45:37 +0300 Subject: [PATCH] update compute status feedback messages --- src/@utils/feedback.ts | 3 ++- .../Asset/AssetActions/Compute/index.tsx | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/@utils/feedback.ts b/src/@utils/feedback.ts index ae4809205..6e936cc5c 100644 --- a/src/@utils/feedback.ts +++ b/src/@utils/feedback.ts @@ -20,6 +20,7 @@ export function getComputeFeedback( 0: `Setting price and fees for ${assetType}`, 1: `Approving ${datatokenSymbol} and ordering ${assetType} `, 2: `Approving ${baseTokenSymbol} and ordering ${assetType}`, - 3: 'Generating signature. Starting compute job ...' + 3: `Ordering ${assetType}`, + 4: 'Generating signature. Starting compute job ...' } } diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index 899be9883..1ccee8cb8 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -215,7 +215,6 @@ export default function Compute({ algoPoolParams, initializedProvider.algorithm.providerFee ) - console.log('algorithmOrderPriceAndFees', algorithmOrderPriceAndFees) if (!algorithmOrderPriceAndFees) { setError('Error setting algorithm price and fees!') toast.error('Error setting algorithm price and fees!') @@ -304,7 +303,13 @@ export default function Compute({ asset.accessDetails.baseToken?.symbol, asset.accessDetails.datatoken?.symbol, asset.metadata.type - )[asset.accessDetails?.type === 'fixed' ? 2 : 1] + )[ + asset.accessDetails?.type === 'fixed' + ? 2 + : asset.accessDetails?.type === 'dynamic' + ? 1 + : 3 + ] ) const datasetOrderTx = await handleComputeOrder( web3, @@ -321,7 +326,13 @@ export default function Compute({ selectedAlgorithmAsset.accessDetails.baseToken?.symbol, selectedAlgorithmAsset.accessDetails.datatoken?.symbol, selectedAlgorithmAsset.metadata.type - )[selectedAlgorithmAsset.accessDetails?.type === 'fixed' ? 2 : 1] + )[ + selectedAlgorithmAsset.accessDetails?.type === 'fixed' + ? 2 + : selectedAlgorithmAsset.accessDetails?.type === 'dynamic' + ? 1 + : 3 + ] ) const algorithmOrderTx = await handleComputeOrder( web3, @@ -343,7 +354,7 @@ export default function Compute({ publishAlgorithmLog: true, publishOutput: true } - setComputeStatusText(getComputeFeedback()[3]) + setComputeStatusText(getComputeFeedback()[4]) const response = await ProviderInstance.computeStart( asset.services[0].serviceEndpoint, web3,