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

Commit

Permalink
fix: bug that caused success page after confirmation of 0-conf (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Sep 19, 2019
1 parent 60ae870 commit 2c0f6b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/actions/reverseActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const handleReverseSwapStatus = (
switch (status) {
case SwapUpdateEvent.TransactionConfirmed:
dispatch(setReverseSwapStatus('Waiting for invoice to be paid...'));
nextStage();
nextStage(true);
break;

case SwapUpdateEvent.TransactionRefunded:
Expand Down
10 changes: 9 additions & 1 deletion src/views/reverse/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const styles = () => ({
});

class ReverseSwap extends React.Component {
acceptedZeroConf = false;

constructor(props) {
super(props);

Expand Down Expand Up @@ -144,6 +146,8 @@ class ReverseSwap extends React.Component {
swapInfo={swapInfo}
swapResponse={swapResponse}
setAllowZeroConf={allow => {
this.acceptedZeroConf = true;

this.setState({
allowZeroConf: allow,
});
Expand Down Expand Up @@ -195,7 +199,11 @@ class ReverseSwap extends React.Component {
if (swapInfo.address && swapInfo.address !== '') {
startReverseSwap(
swapInfo,
props.nextStage,
confirmedEvent => {
if (!confirmedEvent || !this.acceptedZeroConf) {
props.nextStage();
}
},
goTimelockExpired
);
props.nextStage();
Expand Down

0 comments on commit 2c0f6b1

Please sign in to comment.