File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 22
22
23
23
let inputElem: HTMLInputElement
24
24
let insufficientBalance = false
25
- let tokenBalance : FetchBalanceResult
25
+ let tokenBalanceResult : FetchBalanceResult
26
26
27
27
$ : value = amount ? formatUnits (amount , token .decimals ) : ' '
28
28
$ : isTokenSelected = Boolean (token )
29
- $ : balance = tokenBalance ? ` ${truncateString (tokenBalance .formatted , 8 )} ${tokenBalance .symbol } ` : ' '
29
+ $ : balance = tokenBalanceResult
30
+ ? ` ${truncateString (tokenBalanceResult .formatted , 8 )} ${tokenBalanceResult .symbol } `
31
+ : ' '
30
32
31
33
function onTokenSelect(_token : Token ) {
32
34
token = _token
43
45
insufficientBalance = false
44
46
45
47
// Do we have enough balance to cover the amount?
46
- if (amount > tokenBalance .value ) {
48
+ if (amount > tokenBalanceResult .value ) {
47
49
insufficientBalance = true
48
50
}
49
51
}
54
56
if (! token || ! chainId || ! address ) return
55
57
56
58
try {
57
- tokenBalance = await getBalance ({
59
+ tokenBalanceResult = await getBalance ({
58
60
address ,
59
61
chainId ,
60
62
token: token ?.address ,
You can’t perform that action at this time.
0 commit comments