Skip to content

Commit dd92787

Browse files
committed
fix:shouldTriggerOnSuccess amount validate
1 parent 55585ae commit dd92787

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

react/lib/util/validate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import BigNumber from "bignumber.js";
22
import { getAddressPrefix, getCurrencyTypeFromAddress } from "./address";
33
import { resolveNumber } from "./number";
44
import { Currency, CurrencyObject, Transaction } from "./types";
5-
import { DECIMALS } from "./constants";
5+
import { CRYPTO_CURRENCIES, DECIMALS } from "./constants";
66

77
export const shouldTriggerOnSuccess = (
88
transaction: Transaction,
@@ -33,7 +33,7 @@ export const shouldTriggerOnSuccess = (
3333
const transactionCurrency: Currency = getCurrencyTypeFromAddress(address);
3434
if (transactionCurrency !== currency) {
3535
if (currencyObject){
36-
const value = (currencyObject.float / price).toFixed(DECIMALS[transactionCurrency])
36+
const value = CRYPTO_CURRENCIES.includes(currencyObject.currency) ? currencyObject.float : (currencyObject.float / price).toFixed(DECIMALS[transactionCurrency])
3737
isAmountValid = resolveNumber(value).isEqualTo(amount)
3838
}else {
3939
isAmountValid = false

0 commit comments

Comments
 (0)