fix: change address and Select All coins
This commit is contained in:
@@ -14,11 +14,9 @@ async function payment(path) {
|
||||
watch: {
|
||||
immediate: true,
|
||||
accounts() {
|
||||
console.log('### watch accounts', newVal)
|
||||
this.updateChangeAddress()
|
||||
},
|
||||
addresses(newVal) {
|
||||
console.log('### watch addresses', newVal)
|
||||
addresses() {
|
||||
this.updateChangeAddress()
|
||||
}
|
||||
},
|
||||
@@ -144,12 +142,11 @@ async function payment(path) {
|
||||
// change account deleted
|
||||
if (!changeAccount) {
|
||||
this.changeWallet = this.accounts[0]
|
||||
this.selectChangeAddress(this.changeWallet)
|
||||
}
|
||||
} else {
|
||||
this.changeWallet = this.accounts[0]
|
||||
this.selectChangeAddress(this.changeWallet)
|
||||
}
|
||||
this.selectChangeAddress(this.changeWallet)
|
||||
},
|
||||
getTotalPaymentAmount: function () {
|
||||
return this.sendToList.reduce((t, a) => t + (a.amount || 0), 0)
|
||||
|
||||
@@ -102,17 +102,18 @@ async function utxoList(path) {
|
||||
return total
|
||||
},
|
||||
applyUtxoSelectionMode: function () {
|
||||
const isSelectAll = mode === 'Select All'
|
||||
if (isSelectAll) {
|
||||
this.utxos.data.forEach(u => (u.selected = true))
|
||||
return
|
||||
}
|
||||
|
||||
const payedAmount = this['payed-amount']
|
||||
const mode = this.payment.utxoSelectionMode
|
||||
this.utxos.data.forEach(u => (u.selected = false))
|
||||
const isManual = mode === 'Manual'
|
||||
if (isManual || !payedAmount) return
|
||||
|
||||
const isSelectAll = mode === 'Select All'
|
||||
if (isSelectAll || payedAmount >= this.utxos.total) {
|
||||
this.utxos.data.forEach(u => (u.selected = true))
|
||||
return
|
||||
}
|
||||
const isSmallerFirst = mode === 'Smaller Inputs First'
|
||||
const isLargerFirst = mode === 'Larger Inputs First'
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class="btn-full"
|
||||
color="secondary"
|
||||
@click="scanAllAddresses"
|
||||
:disabled="scan.scanning == true"
|
||||
:disabled="scan.scanning == true || showPayment"
|
||||
>Scan Blockchain</q-btn
|
||||
>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user