Estimate fee correct error message and amount input type.
This commit is contained in:
@@ -280,7 +280,7 @@ export const TxUI: FC<UIProps> = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="number"
|
||||||
value={tokenAmount.value}
|
value={tokenAmount.value}
|
||||||
placeholder="Value"
|
placeholder="Value"
|
||||||
onChange={e => {
|
onChange={e => {
|
||||||
@@ -294,14 +294,9 @@ export const TxUI: FC<UIProps> = ({
|
|||||||
) : (
|
) : (
|
||||||
<Input
|
<Input
|
||||||
css={{ flex: 'inherit' }}
|
css={{ flex: 'inherit' }}
|
||||||
type="text"
|
type="number"
|
||||||
value={value}
|
value={value}
|
||||||
onChange={e => handleSetField(field, e.target.value)}
|
onChange={e => handleSetField(field, e.target.value)}
|
||||||
onKeyPress={e => {
|
|
||||||
if (e.key === '.' || e.key === ',') {
|
|
||||||
e.preventDefault()
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ const estimateFee = async (
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!opts.silent) {
|
if (!opts.silent) {
|
||||||
console.error(err)
|
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
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user