From 51413f293ac594aa2efaa07cc64a1d1847484090 Mon Sep 17 00:00:00 2001 From: Emil Johansson Date: Sat, 1 Feb 2020 13:43:15 +0100 Subject: [PATCH] Change error handling in checkAmountSuppliedAndGoPayLightningConfirm. Amount will be an empty string when user have not specified in the view before pressing "pay". --- src/action/payment.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/action/payment.js b/src/action/payment.js index 76b39ae8a..99b0202f8 100644 --- a/src/action/payment.js +++ b/src/action/payment.js @@ -187,12 +187,12 @@ class PaymentAction { * If payment amount is 0 the function will display a message and return. */ async checkAmountSuppliedAndGoPayLightningConfirm() { - if (this._store.payment.amount === '0') { - this._notification.display({ msg: 'Enter amount to pay.' }); - } else if ( - this._store.payment.destination === '' || + if ( + this._store.payment.amount === '0' || this._store.payment.amount === '' ) { + this._notification.display({ msg: 'Enter amount to pay.' }); + } else if (this._store.payment.destination === '') { this._notification.display({ msg: 'Internal Error, try again.' }); this._nav.goHome(); } else {