Skip to content

Commit d0a00a8

Browse files
authored
fix: crash (#217)
1 parent 16f9103 commit d0a00a8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"axios": "^1.7.7",
7373
"bootstrap": "^4.5.3",
7474
"brace": "^0.11.1",
75-
"core-js": "^3.38.1",
75+
"core-js": "^3.39.0",
7676
"electron": "^33.0.2",
7777
"idb-keyval": "^6.2.1",
7878
"js-file-download": "^0.4.12",

src/views/demos/PayerAppSimulator/PayerApp.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,13 @@ class PayerMobile extends React.Component {
290290
});
291291
}
292292
if(this.state.fxQuoteResponse && this.state.fxQuoteResponse.conversionTerms && this.state.fxQuoteResponse.conversionTerms.sourceAmount && this.state.fxQuoteResponse.conversionTerms.targetAmount) {
293+
let conversionFee = 0;
294+
if(this.state.fxQuoteResponse.conversionTerms.charges) {
295+
conversionFee = Math.round(this.state.fxQuoteResponse.conversionTerms.charges.reduce((acc, obj) => acc + Number(obj.targetAmount.amount), 0));
296+
}
293297
steps.push({
294298
title: 'Conversion Terms',
295-
description: <>Sending Amount: {this.state.fxQuoteResponse.conversionTerms.sourceAmount.currency} {this.state.fxQuoteResponse.conversionTerms.sourceAmount.amount}<br />Conversion fee: {this.state.fxQuoteResponse.conversionTerms.targetAmount.currency} {Math.round(this.state.fxQuoteResponse.conversionTerms.charges.reduce((acc, obj) => acc + Number(obj.targetAmount.amount), 0))}<br />Converted Amount: {this.state.fxQuoteResponse.conversionTerms.targetAmount.currency} {this.state.fxQuoteResponse.conversionTerms.targetAmount.amount}</>,
299+
description: <>Sending Amount: {this.state.fxQuoteResponse.conversionTerms.sourceAmount.currency} {this.state.fxQuoteResponse.conversionTerms.sourceAmount.amount}<br />Conversion fee: {this.state.fxQuoteResponse.conversionTerms.targetAmount.currency} {conversionFee}<br />Converted Amount: {this.state.fxQuoteResponse.conversionTerms.targetAmount.currency} {this.state.fxQuoteResponse.conversionTerms.targetAmount.amount}</>,
296300
status: 'finish',
297301
});
298302
}

0 commit comments

Comments
 (0)