Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Change error handling in checkAmountSuppliedAndGoPayLightningConfirm.
Browse files Browse the repository at this point in the history
Amount will be an empty string when user have not specified in the view before
pressing "pay".
  • Loading branch information
emiljoha committed Feb 1, 2020
1 parent 55985e7 commit 51413f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/action/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 51413f2

Please sign in to comment.