From bacbd3dfcee411374aa66ff6e4ae74d392bc6204 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Sun, 12 Sep 2021 00:40:53 +0100 Subject: [PATCH] fix bug --- tauri-wallet/src/utils/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tauri-wallet/src/utils/index.ts b/tauri-wallet/src/utils/index.ts index 19c23454df..f64530eee5 100644 --- a/tauri-wallet/src/utils/index.ts +++ b/tauri-wallet/src/utils/index.ts @@ -20,6 +20,9 @@ export const validateAmount = async ( minimum: string ): Promise => { // tests basic coin value requirements, like no more than 6 decimal places, value lower than total supply, etc + if (!Number(amount)) { + return false + } try { const minorValueStr: Coin = await invoke('major_to_minor', { @@ -42,10 +45,6 @@ export const validateAmount = async ( } export const basicRawCoinValueValidation = (rawAmount: string): boolean => { - if (!Number(rawAmount)) { - return false - } - debugger const amountFloat = parseFloat(rawAmount) // it cannot have more than 6 decimal places