1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-02-14 21:10:38 +01:00

remove redundant symbol calls

This commit is contained in:
Matthias Kretschmann 2020-10-19 13:11:53 +02:00
parent a565e83220
commit bf689e7c02
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -7,8 +7,8 @@ import { getBestDataTokenPrice, getFirstPool } from 'utils/dtUtils'
import { Decimal } from 'decimal.js' import { Decimal } from 'decimal.js'
interface UsePricing { interface UsePricing {
dtSymbol: string | undefined dtSymbol?: string
dtName: string | undefined dtName?: string
createPricing: ( createPricing: (
priceOptions: PriceOptions priceOptions: PriceOptions
) => Promise<TransactionReceipt | string | null> ) => Promise<TransactionReceipt | string | null>
@ -109,7 +109,6 @@ function usePricing(ddo: DDO): UsePricing {
if (!ocean || !account || !accountId) return null if (!ocean || !account || !accountId) return null
try { try {
setDtSymbol(await ocean.datatokens.getSymbol(dataToken))
setPricingIsLoading(true) setPricingIsLoading(true)
setPricingError(undefined) setPricingError(undefined)
setStepBuyDT(0) setStepBuyDT(0)
@ -186,7 +185,6 @@ function usePricing(ddo: DDO): UsePricing {
} }
try { try {
setDtSymbol(await ocean.datatokens.getSymbol(dataToken))
setPricingIsLoading(true) setPricingIsLoading(true)
setPricingError(undefined) setPricingError(undefined)
setStepSellDT(0) setStepSellDT(0)
@ -224,7 +222,6 @@ function usePricing(ddo: DDO): UsePricing {
try { try {
setPricingIsLoading(true) setPricingIsLoading(true)
setPricingError(undefined) setPricingError(undefined)
setDtSymbol(await ocean.datatokens.getSymbol(dataToken))
setStepCreatePricing(0) setStepCreatePricing(0)
switch (priceOptions.type) { switch (priceOptions.type) {