Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #101 from BoltzExchange/joule-amount-fix
Browse files Browse the repository at this point in the history
fix: Joule make invoice amounts
  • Loading branch information
michael1011 authored Feb 19, 2019
2 parents 4b29986 + f1bdb5a commit 5f3b526
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/views/reverse/reverseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ const broadcastClaim = (currency, claimTransaction, cb) => {
})
.then(() => cb())
.catch(error => {
window.alert(`Failed to broadcast claim transaction`);
dispatch(reverseSwapResponse(false, error.data));
const message = error.response.data.error;

window.alert(`Failed to broadcast claim transaction: ${message}`);
dispatch(reverseSwapResponse(false, message));
});
};
};
8 changes: 6 additions & 2 deletions src/views/swap/steps/inputInvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import injectSheet from 'react-jss';
import { FaBolt } from 'react-icons/fa';
import View from '../../../components/view';
import InputArea from '../../../components/inputarea';
import { getCurrencyName, getSampleInvoice } from '../../../scripts/utils';
import {
getCurrencyName,
getSampleInvoice,
toSatoshi,
} from '../../../scripts/utils';

const InputInvoiceStyles = () => ({
wrapper: {
Expand Down Expand Up @@ -38,7 +42,7 @@ class StyledInputInvoice extends React.Component {
const { swapInfo, webln } = this.props;

if (webln) {
webln.makeInvoice(swapInfo.quoteAmount).then(response => {
webln.makeInvoice(toSatoshi(swapInfo.quoteAmount)).then(response => {
const invoice = response.paymentRequest;

this.setState({ value: invoice });
Expand Down

0 comments on commit 5f3b526

Please sign in to comment.