Skip to content

Commit

Permalink
fix: review validation to can send flag inside Send View
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleySuira committed Dec 1, 2022
1 parent a2d7ddd commit 5a40321
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/views/Send/Send.vue
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,10 @@ export default {
return supportCustomFees
},
canSend() {
if (!this.address || this.addressError) return false
if (BN(this.amount).lte(0) || this.amountError) return false
return true
if (this.address && !this.addressError && BN(this.amount).gt(0) && !this.amountError) {
return true
}
return false
},
prettyFee() {
return this.currentFee.dp(6)
Expand Down Expand Up @@ -523,21 +523,23 @@ export default {
this.currentStep = 'inputs'
},
review() {
if (this.account?.type.includes('ledger') && this.$route.query?.mode !== 'tab') {
// open in a new tab
const sendParams = qs.stringify({
mode: 'tab',
selectedFee: this.selectedFee,
amount: BN(this.amount).toString(),
address: this.address,
currentStep: 'confirm',
maxOptionActive: this.maxOptionActive,
customFee: this.customFee
})
const url = `/index.html#/accounts/${this.accountId}/${this.asset}/send?${sendParams}`
chrome.tabs.create({ url: browser.runtime.getURL(url) })
} else {
this.currentStep = 'confirm'
if (this.canSend) {
if (this.account?.type.includes('ledger') && this.$route.query?.mode !== 'tab') {
// open in a new tab
const sendParams = qs.stringify({
mode: 'tab',
selectedFee: this.selectedFee,
amount: BN(this.amount).toString(),
address: this.address,
currentStep: 'confirm',
maxOptionActive: this.maxOptionActive,
customFee: this.customFee
})
const url = `/index.html#/accounts/${this.accountId}/${this.asset}/send?${sendParams}`
chrome.tabs.create({ url: browser.runtime.getURL(url) })
} else {
this.currentStep = 'confirm'
}
}
},
async send() {
Expand Down

0 comments on commit 5a40321

Please sign in to comment.