Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Fix UI taking wrongly the confirmations
Browse files Browse the repository at this point in the history
This happened on the Transaction List and Searched transactions
  • Loading branch information
pedro committed Jul 26, 2021
1 parent 0ebf508 commit 760bdeb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/transactions/TransactionRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
</template>

<script>
import BigNumber from 'bignumber.js'
import Modal from '@/components/commons/Modal.vue'
import { store } from '@/store.js'
import {
Expand Down Expand Up @@ -202,9 +203,15 @@ export default {
neededConfirmations() {
const limits = this.typesLimits[this.token.typeId]
const confirmations = this.fromNetwork.isRsk ? this.rskConfirmations : this.ethConfirmations
return this.transaction.amount < limits.mediumAmount
let amount = this.transaction.amount
if (!amount) {
// add fees to receiveAmount to get the original amount
// TODO use props fee instead of harcoded 0.2%
amount = this.transaction.receiveAmount / (1 - 0.002)
}
return amount < new BigNumber(limits.mediumAmount).shiftedBy(-18).toNumber()
? confirmations.smallAmount
: this.transaction.amount < limits.largeAmount
: amount < new BigNumber(limits.largeAmount).shiftedBy(-18)
? confirmations.mediumAmount
: confirmations.largeAmount
},
Expand Down

0 comments on commit 760bdeb

Please sign in to comment.