From de253eb60de0d5e9e64030e4aa346854f955c470 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 16 Feb 2018 22:28:22 +0300 Subject: [PATCH] update explorers list --- .../components/dashboard/sendCoin/sendCoin.js | 3 +- .../dashboard/sendCoin/sendCoin.render.js | 4 +- .../dashboard/walletsTxInfo/walletsTxInfo.js | 3 +- .../walletsTxInfo/walletsTxInfo.render.js | 4 +- react/src/util/explorerList.js | 50 +++++++++++++++++++ 5 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 react/src/util/explorerList.js diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index d4f43ae..fa25209 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -22,6 +22,7 @@ import { } from './sendCoin.render'; import { isPositiveNumber } from '../../../util/number'; import mainWindow from '../../../util/mainWindow'; +import explorerList from '../../../util/explorerList'; import Slider, { Range } from 'rc-slider'; import ReactTooltip from 'react-tooltip'; @@ -103,7 +104,7 @@ class SendCoin extends React.Component { } openExplorerWindow(txid) { - const url = `http://${this.props.ActiveCoin.coin}.explorer.supernet.org/tx/${txid}`; + const url = explorerList[this.props.ActiveCoin.coin].split('/').length - 1 > 2 ? `${explorerList[this.props.ActiveCoin.coin]}${txid}` : `${explorerList[this.props.ActiveCoin.coin]}/tx/${txid}`; const remote = window.require('electron').remote; const BrowserWindow = remote.BrowserWindow; diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index fbb6b21..5da3156 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -1,8 +1,8 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import QRModal from '../qrModal/qrModal'; -import { isKomodoCoin } from '../../../util/coinHelper'; import { formatValue } from '../../../util/formatValue'; +import explorerList from '../../../util/explorerList'; import ReactTooltip from 'react-tooltip'; export const AddressListRender = function() { @@ -373,7 +373,7 @@ export const SendRender = function() { this.state.lastSendToResponse && this.state.lastSendToResponse.txid) || (this.props.ActiveCoin.mode === 'native' && this.state.lastSendToResponse && this.state.lastSendToResponse.length === 64)) && - isKomodoCoin(this.props.ActiveCoin.coin) && + explorerList[this.props.ActiveCoin.coin] &&