Estimate fee correct error message and amount input type.

This commit is contained in:
muzam1l
2023-03-17 18:57:03 +05:30
parent e08b07cbeb
commit e27a71d713
2 changed files with 4 additions and 8 deletions

View File

@@ -280,7 +280,7 @@ export const TxUI: FC<UIProps> = ({
}}
/>
<Input
type="text"
type="number"
value={tokenAmount.value}
placeholder="Value"
onChange={e => {
@@ -294,14 +294,9 @@ export const TxUI: FC<UIProps> = ({
) : (
<Input
css={{ flex: 'inherit' }}
type="text"
type="number"
value={value}
onChange={e => handleSetField(field, e.target.value)}
onKeyPress={e => {
if (e.key === '.' || e.key === ',') {
e.preventDefault()
}
}}
/>
)}
<Box

View File

@@ -31,7 +31,8 @@ const estimateFee = async (
} catch (err) {
if (!opts.silent) {
console.error(err)
toast.error('Cannot estimate fee.') // ? Some better msg
const msg = err instanceof Error ? err.message : 'Error estimating fee!';
toast.error(msg);
}
return null
}