diff --git a/app/actions/GatewayActions.js b/app/actions/GatewayActions.js index fa988a3d65..98f281f9be 100644 --- a/app/actions/GatewayActions.js +++ b/app/actions/GatewayActions.js @@ -9,17 +9,20 @@ class GatewayActions { if (!inProgress["fetchCoins_" + backer]) { inProgress["fetchCoins_" + backer] = true; return (dispatch) => { - Promise.all([fetchCoins(url), + Promise.all([ + fetchCoins(url), fetchBridgeCoins(blockTradesAPIs.BASE_OL), getActiveWallets(url) ]).then(result => { delete inProgress["fetchCoins_" + backer]; let [coins, tradingPairs, wallets] = result; + let backedCoins = getBackedCoins({allCoins: coins, tradingPairs: tradingPairs, backer: backer}).filter(a => !!a.walletType); + backedCoins.forEach(a => { + a.isAvailable = wallets.indexOf(a.walletType) !== -1; + }); dispatch({ - coins: coins, - backedCoins: getBackedCoins({allCoins: coins, tradingPairs: tradingPairs, backer: backer}).filter(a => { - return wallets.indexOf(a.walletType) !== -1; - }), + coins, + backedCoins, backer }); }); diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index ed4ec12965..68040691d4 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -1286,7 +1286,8 @@ "min_amount": "Minimum amount: %(minAmount)s %(symbol)s", "min_amount_error": "Please enter number >= minimum", "coming_soon": "Coming soon" - } + }, + "unavailable": "The gateway service for this asset is currently down, please try again later" }, "chat": { "title": "Chat", diff --git a/app/components/Account/AccountDepositWithdraw.jsx b/app/components/Account/AccountDepositWithdraw.jsx index 0a3c2edd05..9f03d87ac9 100644 --- a/app/components/Account/AccountDepositWithdraw.jsx +++ b/app/components/Account/AccountDepositWithdraw.jsx @@ -111,7 +111,7 @@ class AccountDepositWithdraw extends React.Component { }); } - renderServices(blockTradesGatewayCoins, openLedgerGatewayCoins, rudexGatewayCoins) { + renderServices(openLedgerGatewayCoins, rudexGatewayCoins) { //let services = ["Openledger (OPEN.X)", "BlockTrades (TRADE.X)", "Transwiser", "BitKapital"]; let serList = []; let { account } = this.props; @@ -236,23 +236,7 @@ class AccountDepositWithdraw extends React.Component { let { account } = this.props; let { activeService } = this.state; - let blockTradesGatewayCoins = this.props.blockTradesBackedCoins.filter(coin => { - if (coin.backingCoinType.toLowerCase() === "muse") { - return false; - } - return coin.symbol.toUpperCase().indexOf("TRADE") !== -1; - }) - .map(coin => { - return coin; - }) - .sort((a, b) => { - if (a.symbol < b.symbol) - return -1; - if (a.symbol > b.symbol) - return 1; - return 0; - }); - + console.log("openLedgerBackedCoins", this.props.openLedgerBackedCoins); let openLedgerGatewayCoins = this.props.openLedgerBackedCoins.map(coin => { return coin; }) @@ -275,7 +259,7 @@ class AccountDepositWithdraw extends React.Component { return 0; }); - let services = this.renderServices(blockTradesGatewayCoins, openLedgerGatewayCoins, rudexGatewayCoins); + let services = this.renderServices(openLedgerGatewayCoins, rudexGatewayCoins); let options = services.map((services_obj, index) => { return ; diff --git a/app/components/DepositWithdraw/BlockTradesGateway.jsx b/app/components/DepositWithdraw/BlockTradesGateway.jsx index 69da001247..a2f4d8885c 100644 --- a/app/components/DepositWithdraw/BlockTradesGateway.jsx +++ b/app/components/DepositWithdraw/BlockTradesGateway.jsx @@ -164,6 +164,7 @@ class BlockTradesGateway extends React.Component { receive_asset={coin.symbol} receive_coin_type={coin.symbol.toLowerCase()} supports_output_memos={coin.supportsMemos} + isAvailable={coin.isAvailable} action={this.state.action} /> diff --git a/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx b/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx index f2d2a788b8..9a1e80f59a 100644 --- a/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx +++ b/app/components/DepositWithdraw/blocktrades/BlockTradesGatewayDepositRequest.jsx @@ -5,7 +5,6 @@ import ChainTypes from "components/Utility/ChainTypes"; import BindToChainState from "components/Utility/BindToChainState"; import WithdrawModalBlocktrades from "./WithdrawModalBlocktrades"; import BaseModal from "../../Modal/BaseModal"; -import Trigger from "react-foundation-apps/src/trigger"; import ZfApi from "react-foundation-apps/src/utils/foundation-api"; import AccountBalance from "../../Account/AccountBalance"; import BlockTradesDepositAddressCache from "common/BlockTradesDepositAddressCache"; @@ -13,6 +12,7 @@ import AssetName from "components/Utility/AssetName"; import LinkToAccountById from "components/Blockchain/LinkToAccountById"; import {requestDepositAddress} from "common/blockTradesMethods"; import { blockTradesAPIs } from "api/apiConfig"; +import LoadingIndicator from "components/LoadingIndicator"; class BlockTradesGatewayDepositRequest extends React.Component { static propTypes = { @@ -160,7 +160,7 @@ class BlockTradesGatewayDepositRequest extends React.Component { if( !receive_address ) { requestDepositAddress(this._getDepositObject()); - return emptyRow; + return