Check if they've balance to create both on fe

This commit is contained in:
Ian Philips 2022-08-05 09:30:54 -06:00
parent 15d7e1b03d
commit 3eb64b263c

View File

@ -123,7 +123,15 @@ function CreateChallengeForm(props: {
onSubmit={(e) => {
e.preventDefault()
if (user.balance < challengeInfo.amount) {
setError('You do not have enough mana to create this challenge')
setError("You don't have enough mana to create this challenge")
return
}
if (!contract && user.balance < FIXED_ANTE + challengeInfo.amount) {
setError(
`You don't have enough mana to create this challenge and market. You need ${formatMoney(
FIXED_ANTE + challengeInfo.amount
)}`
)
return
}
setIsCreating(true)