Fix double alert on swap timeout (#1034)

This commit is contained in:
James Prado 2018-02-09 11:07:38 -05:00 committed by Daniel Ternyak
parent 8a9e5b34d6
commit 4e092d5177
2 changed files with 5 additions and 8 deletions

View File

@ -1,7 +1,6 @@
import { TShowNotification } from 'actions/notifications';
import {
TRestartSwap,
TStartOrderTimerSwap,
TStartPollBityOrderStatus,
TStartPollShapeshiftOrderStatus,
TStopOrderTimerSwap,
@ -30,7 +29,6 @@ interface ReduxStateProps {
interface ReduxActionProps {
restartSwap: TRestartSwap;
startOrderTimerSwap: TStartOrderTimerSwap;
startPollBityOrderStatus: TStartPollBityOrderStatus;
stopPollBityOrderStatus: TStopPollBityOrderStatus;
startPollShapeshiftOrderStatus: TStartPollShapeshiftOrderStatus;
@ -47,7 +45,6 @@ export default class PartThree extends PureComponent<ReduxActionProps & ReduxSta
} else {
this.props.startPollBityOrderStatus();
}
this.props.startOrderTimerSwap();
}
public componentWillUnmount() {

View File

@ -319,19 +319,19 @@ export function* shapeshiftOrderTimeRemaining(): SagaIterator {
} else {
switch (swap.shapeshiftOrderStatus) {
case 'no_deposits':
yield put(orderTimeSwap(0));
yield put(stopPollShapeshiftOrderStatus());
yield put(stopLoadShapeshiftRatesSwap());
if (!hasShownNotification) {
hasShownNotification = true;
yield put(orderTimeSwap(0));
yield put(stopPollShapeshiftOrderStatus());
yield put(stopLoadShapeshiftRatesSwap());
yield put(showNotification('danger', ORDER_TIMEOUT_MESSAGE, Infinity));
}
break;
case 'failed':
yield put(stopPollShapeshiftOrderStatus());
yield put(stopLoadShapeshiftRatesSwap());
if (!hasShownNotification) {
hasShownNotification = true;
yield put(stopPollShapeshiftOrderStatus());
yield put(stopLoadShapeshiftRatesSwap());
yield put(showNotification('danger', ORDER_TIMEOUT_MESSAGE, Infinity));
}
break;