Skip to content

Commit

Permalink
Progress loading while computing max send amount
Browse files Browse the repository at this point in the history
  • Loading branch information
joemarct committed Oct 11, 2022
1 parent c3871c3 commit 9e3d41f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/transaction/send.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
filled
v-model="sendData.amount"
label="Amount"
:loading="computingMax"
:disabled="disableAmountInput || setAmountInFiat"
:readonly="disableAmountInput || setAmountInFiat"
:dark="darkMode"
Expand Down Expand Up @@ -373,7 +374,8 @@ export default {
showQrScanner: false,
setAmountInFiat: false,
sendAmountInFiat: null,
balanceExceeded: false
balanceExceeded: false,
computingMax: false
}
},
Expand Down Expand Up @@ -703,11 +705,16 @@ export default {
async setMaximumSendAmount () {
if (this.asset.id === 'bch') {
if (this.isSep20) {
this.computingMax = true
const spendable = await this.wallet.sBCH.getMaxSpendableBch(
String(this.asset.balance),
this.sendData.recipient
)
this.sendData.amount = spendable
this.computingMax = false
if (spendable < 0) {
this.sendErrors.push('Not enough balance to cover the gas fee')
}
} else {
this.sendData.amount = this.asset.spendable
}
Expand Down

0 comments on commit 9e3d41f

Please sign in to comment.