diff --git a/src/renderer/component/shapeShift/internal/active-shift.jsx b/src/renderer/component/shapeShift/internal/active-shift.jsx index 7d2af51c9..5b7bd3d95 100644 --- a/src/renderer/component/shapeShift/internal/active-shift.jsx +++ b/src/renderer/component/shapeShift/internal/active-shift.jsx @@ -56,7 +56,7 @@ class ActiveShapeShift extends React.PureComponent { } } - continousFetch: ?number; + continousFetch: ?IntervalID; render() { const { @@ -135,8 +135,8 @@ class ActiveShapeShift extends React.PureComponent { {shiftState === statuses.NO_DEPOSITS && shiftReturnAddress && (
- If the transaction doesn't go through, ShapeShift will return your {shiftCoinType}{' '} - back to {shiftReturnAddress} + {__("If the transaction doesn't go through, ShapeShift will return your")}{' '} + {shiftCoinType} {__('back to')} {shiftReturnAddress}
)} diff --git a/src/renderer/constants/shape_shift.js b/src/renderer/constants/shape_shift.js index 1436f50d0..342cde4f4 100644 --- a/src/renderer/constants/shape_shift.js +++ b/src/renderer/constants/shape_shift.js @@ -1,3 +1,5 @@ export const NO_DEPOSITS = 'no_deposits'; export const RECEIVED = 'received'; export const COMPLETE = 'complete'; +export const AVAILABLE = 'available'; +export const UNAVAILABLE = 'unavailable'; diff --git a/src/renderer/redux/actions/shape_shift.js b/src/renderer/redux/actions/shape_shift.js index 293b565ef..d68b54f9c 100644 --- a/src/renderer/redux/actions/shape_shift.js +++ b/src/renderer/redux/actions/shape_shift.js @@ -1,5 +1,6 @@ // @flow import Promise from 'bluebird'; +import * as SHAPESHIFT_STATUSES from 'constants/shape_shift'; import * as ACTIONS from 'constants/action_types'; import { coinRegexPatterns } from 'util/shape_shift'; import type { @@ -65,9 +66,15 @@ export const shapeShiftInit = () => (dispatch: Dispatch): ThunkAction => { return shapeShift .coinsAsync() .then(coinData => { + if (coinData.LBC.status === SHAPESHIFT_STATUSES.UNAVAILABLE) { + return dispatch({ + type: ACTIONS.GET_SUPPORTED_COINS_FAIL, + }); + } + let supportedCoins = []; Object.keys(coinData).forEach(symbol => { - if (coinData[symbol].status === 'available') { + if (coinData[symbol].status === SHAPESHIFT_STATUSES.UNAVAILABLE) { supportedCoins.push(coinData[symbol]); } }); @@ -81,7 +88,7 @@ export const shapeShiftInit = () => (dispatch: Dispatch): ThunkAction => { type: ACTIONS.GET_SUPPORTED_COINS_SUCCESS, data: supportedCoins, }); - dispatch(getCoinStats(supportedCoins[0])); + return dispatch(getCoinStats(supportedCoins[0])); }) .catch(err => dispatch({ type: ACTIONS.GET_SUPPORTED_COINS_FAIL, data: err })); }; diff --git a/src/renderer/redux/reducers/shape_shift.js b/src/renderer/redux/reducers/shape_shift.js index ea692e377..60d3216a6 100644 --- a/src/renderer/redux/reducers/shape_shift.js +++ b/src/renderer/redux/reducers/shape_shift.js @@ -117,7 +117,7 @@ export default handleActions( [ACTIONS.GET_SUPPORTED_COINS_FAIL]: (state: ShapeShiftState): ShapeShiftState => ({ ...state, loading: false, - error: 'Error getting available coins', + error: __('There was an error. Please try again later.'), }), [ACTIONS.GET_COIN_STATS_START]: (