Skip to content

Commit

Permalink
Fix bug where empty transaction amount would cause error in console
Browse files Browse the repository at this point in the history
  • Loading branch information
KiOui committed Sep 5, 2023
1 parent 05138f2 commit 3fc3c40
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ <h3>Add a transaction</h3>
scannerModal.show();
},
addTransactionAmount(amount) {
this.transactionAmount = +(this.transactionAmount + amount).toFixed(2);
if (typeof(this.transactionAmount) === "number") {
this.transactionAmount = +(this.transactionAmount + amount).toFixed(2);
} else {
this.transactionAmount = +(amount).toFixed(2)
}
},
addTransaction() {
this.loading = true;
Expand Down

0 comments on commit 3fc3c40

Please sign in to comment.