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

fix txCount on 'Create tokens & pricing' in publish (#1187)

* fix txCount on 'Create tokens & pricing' in publish

* fix description on submit step in publish
This commit is contained in:
EnzoVezzaro 2022-03-16 10:37:28 -04:00 committed by GitHub
parent bea8635a53
commit 8d852323ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { ReactElement, useEffect } from 'react' import { ReactElement, useEffect } from 'react'
import { useFormikContext } from 'formik' import { useFormikContext } from 'formik'
import { wizardSteps } from './_constants' import { wizardSteps, initialPublishFeedback } from './_constants'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'
import { FormPublishData, PublishFeedback } from './_types' import { FormPublishData, PublishFeedback } from './_types'
@ -38,7 +38,7 @@ export function Steps({
'a single transaction', 'a single transaction',
'a single transaction, after an initial approve transaction' 'a single transaction, after an initial approve transaction'
) )
: feedback['1'].description : initialPublishFeedback['1'].description
} }
}) })
}, [values.pricing.type, setFieldValue]) }, [values.pricing.type, setFieldValue])

View File

@ -63,7 +63,15 @@ export default function PublishPage({
...prevState, ...prevState,
'1': { '1': {
...prevState['1'], ...prevState['1'],
status: 'active' status: 'active',
txCount: values.pricing.type === 'dynamic' ? 2 : 1,
description:
values.pricing.type === 'dynamic'
? prevState['1'].description.replace(
'a single transaction',
'a single transaction, after an initial approve transaction'
)
: prevState['1'].description
} }
})) }))
@ -102,7 +110,14 @@ export default function PublishPage({
'1': { '1': {
...prevState['1'], ...prevState['1'],
status: 'error', status: 'error',
errorMessage: error.message errorMessage: error.message,
description:
values.pricing.type === 'dynamic'
? prevState['1'].description.replace(
'a single transaction',
'a single transaction, after an initial approve transaction'
)
: prevState['1'].description
} }
})) }))
} }