From 7bb14f50ba26adbc9279f7098907e1d57cec4016 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 31 Mar 2022 15:20:25 +0200 Subject: [PATCH 1/4] add computed TotalBalance and disabled, disabled send button if TotalBalance minus --- .../GddSend/TransactionConfirmationLink.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmationLink.vue b/frontend/src/components/GddSend/TransactionConfirmationLink.vue index 31ae01cc3..bc15c32e6 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationLink.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationLink.vue @@ -33,9 +33,7 @@ {{ $t('form.new_balance') }} - - {{ $t('math.aprox') }} {{ (balance - amount - amount * 0.028) | GDD }} - + {{ $t('math.aprox') }} {{ TotalBalance | GDD }} @@ -44,7 +42,7 @@ {{ $t('form.cancel') }} - + {{ $t('form.generate_now') }} @@ -62,6 +60,18 @@ export default { loading: { type: Boolean, required: true }, selected: { type: String, required: true }, }, + + computed: { + TotalBalance() { + return this.balance - this.amount - this.amount * 0.028 + }, + disabled() { + if (this.TotalBalance < 0) { + return 'disabled' + } + return this.loading + }, + }, }