diff --git a/src/common/utils/apiLooper.ts b/src/common/utils/apiLooper.ts index ae29294475..182e26fe91 100644 --- a/src/common/utils/apiLooper.ts +++ b/src/common/utils/apiLooper.ts @@ -7,8 +7,6 @@ const apiQuery = {} const apiQueryTimers = {} const apiQueryTicks = 10 -const apis = {} - const apiQueryTimer = (queryName) => { if (apiQuery[queryName].length) { const queryChunk = apiQuery[queryName].shift() @@ -155,7 +153,6 @@ const apiLooper = (method, api, endpoint, options) => { .then((answer) => { if (options && options.checkStatus instanceof Function) { if (!options.checkStatus(answer)) { - console.error(`Endpoint ${currentEndpoint.url} - checkStatus failed (may be down). Switch next`) if (switchNext(api)) { doRequest() } else { @@ -185,11 +182,9 @@ const apiLooper = (method, api, endpoint, options) => { } } if (ignoreErrors) { - console.log('Ignore error ^') resolve(answer) return } - console.error(`Endpoint ${currentEndpoint.url} may be offline. Switch next`) if (switchNext(apiName)) { doRequest() } else { diff --git a/src/front/client/index.html b/src/front/client/index.html index 01bcf9206a..16dc23136e 100644 --- a/src/front/client/index.html +++ b/src/front/client/index.html @@ -5,9 +5,10 @@ <%= htmlWebpackPlugin.options.title %> + { diff --git a/src/front/shared/components/BalanceForm/images/dollar2.svg b/src/front/shared/components/BalanceForm/images/dollar2.svg deleted file mode 100644 index c3e023ca0e..0000000000 --- a/src/front/shared/components/BalanceForm/images/dollar2.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/front/shared/components/Header/UserTooltip/UserTooltip.tsx b/src/front/shared/components/Header/UserTooltip/UserTooltip.tsx index 89f40a13ec..66ff8cb1fd 100644 --- a/src/front/shared/components/Header/UserTooltip/UserTooltip.tsx +++ b/src/front/shared/components/Header/UserTooltip/UserTooltip.tsx @@ -43,8 +43,8 @@ export default class UserTooltip extends Component { return ( mePeer === ownerPeer && - request.map(({ participant: { peer }, reputation }, index) => ( -
+ request.map(({ participant: { peer }, reputation }) => ( +
diff --git a/src/front/shared/components/modal/ModalConductor/ModalConductor.tsx b/src/front/shared/components/modal/ModalConductor/ModalConductor.tsx index 11c0ac329a..8a93be9cde 100644 --- a/src/front/shared/components/modal/ModalConductor/ModalConductor.tsx +++ b/src/front/shared/components/modal/ModalConductor/ModalConductor.tsx @@ -60,12 +60,12 @@ export default class ModalConductor extends Component { return areModalsExist && (
{ - modalNames.map((key) => { + modalNames.map((key, index) => { const { name, data = {}, zIndex } = modals[key] if (zIndex === highestZIndex) { return React.createElement(Modals[name], { - key: name, + key: index, name, data, history, diff --git a/src/front/shared/components/modals/InfoInvoice/InfoInvoice.scss b/src/front/shared/components/modals/InfoInvoice/InfoInvoice.scss index 883d4a0c0f..fe85c44040 100644 --- a/src/front/shared/components/modals/InfoInvoice/InfoInvoice.scss +++ b/src/front/shared/components/modals/InfoInvoice/InfoInvoice.scss @@ -142,13 +142,13 @@ color: var(--color); td.header { + @include ff-semibold; text-align: left; - font-weight: bold; font-size: 1.1em; } - td.data { - text-align: justify; + td.responsiveBlock { + @include ff-mono; } } diff --git a/src/front/shared/components/modals/InfoInvoice/InfoInvoice.tsx b/src/front/shared/components/modals/InfoInvoice/InfoInvoice.tsx index 499227043e..01c650cec1 100644 --- a/src/front/shared/components/modals/InfoInvoice/InfoInvoice.tsx +++ b/src/front/shared/components/modals/InfoInvoice/InfoInvoice.tsx @@ -18,11 +18,7 @@ import ShareButton from 'components/controls/ShareButton/ShareButton' import Button from 'components/controls/Button/Button' import { isMobile } from "react-device-detect" - -import imgReady from './images/ready.svg' -import imgPending from './images/pending.svg' -import imgCanceled from './images/cancel.svg' - +import { regularIcons } from 'images' const langPrefix = 'InvoiceInfoModal' const langLabels = defineMessages({ @@ -44,7 +40,7 @@ const langLabels = defineMessages({ }, invoiceComment: { id: `${langPrefix}_Comment`, - defaultMessage: `Комментарий`, + defaultMessage: `Comment`, }, fromAddress: { id: `${langPrefix}_FromAddress`, @@ -292,15 +288,15 @@ class InfoInvoice extends React.Component { switch (status) { case 'ready': infoIconTitle = intl.formatMessage(langLabels.infoStatusReady) - infoIconUrl = imgReady + infoIconUrl = regularIcons.OK break; case 'cancelled': infoIconTitle = intl.formatMessage(langLabels.infoStatusDeclimed) - infoIconUrl = imgCanceled + infoIconUrl = regularIcons.CANCELLED break; default: infoIconTitle = intl.formatMessage(langLabels.infoStatusPending) - infoIconUrl = imgPending + infoIconUrl = regularIcons.PENDING } return ( @@ -384,7 +380,6 @@ class InfoInvoice extends React.Component { {invoiceData.contact} - @@ -392,18 +387,18 @@ class InfoInvoice extends React.Component { - {invoiceData.fromAddress}({invoiceData.invoiceNumber}) + {invoiceData.fromAddress}{' '}({invoiceData.invoiceNumber}) - {invoiceData.toAddress && ( + {invoiceData.destAddress && ( <> - + - - {invoiceData.toAddress} + + {invoiceData.destAddress} )} diff --git a/src/front/shared/components/modals/InfoInvoice/images/ready.svg b/src/front/shared/components/modals/InfoInvoice/images/ready.svg deleted file mode 100644 index cee9cbc4e6..0000000000 --- a/src/front/shared/components/modals/InfoInvoice/images/ready.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/src/front/shared/components/modals/WithdrawBtcPin/WithdrawBtcPin.tsx b/src/front/shared/components/modals/WithdrawBtcPin/WithdrawBtcPin.tsx index 7bc897042b..c18e54b911 100644 --- a/src/front/shared/components/modals/WithdrawBtcPin/WithdrawBtcPin.tsx +++ b/src/front/shared/components/modals/WithdrawBtcPin/WithdrawBtcPin.tsx @@ -260,8 +260,6 @@ class WithdrawBtcPin extends React.Component { data: txInfoCache, }) - helpers.transactions.pullTxBalances(txId, amount, beforeBalances, adminFee) - actions.loader.hide() actions.btcmultisig.getBalancePin() if (invoice) { diff --git a/src/front/shared/components/modals/WithdrawModal/WithdrawModal.tsx b/src/front/shared/components/modals/WithdrawModal/WithdrawModal.tsx index 48949fe684..c30cce232f 100644 --- a/src/front/shared/components/modals/WithdrawModal/WithdrawModal.tsx +++ b/src/front/shared/components/modals/WithdrawModal/WithdrawModal.tsx @@ -224,8 +224,10 @@ class WithdrawModal extends React.Component { + setBtcUserFee = (speedType: string, customValue: number) => { const { bitcoinFees, txSize, currentDecimals } = this.state const feeInByte = speedType === 'custom' ? - //@ts-ignore: strictNullChecks new BigNumber(customValue) : - //@ts-ignore: strictNullChecks new BigNumber(bitcoinFees[speedType]).div(1024).dp(0, BigNumber.ROUND_HALF_EVEN); //@ts-ignore: strictNullChecks const fee = feeInByte.multipliedBy(txSize).multipliedBy(1e-8); - this.setState((state) => ({ - bitcoinFeeSpeedType: speedType, - btcFeeRate: feeInByte.toNumber(), - fees: { - ...state.fees, - miner: fee, - total: state.fees.service.plus(fee).dp(currentDecimals, BigNumber.ROUND_CEIL), - } - })) - this.setAlowedBalances() + if (this.mounted) { + this.setState((state) => ({ + bitcoinFeeSpeedType: speedType, + btcFeeRate: feeInByte.toNumber(), + fees: { + ...state.fees, + miner: fee, + total: state.fees.service.plus(fee).dp(currentDecimals, BigNumber.ROUND_CEIL), + } + })) + this.setAllowedBalances() + } } setCommissions = async () => { @@ -425,7 +427,6 @@ class WithdrawModal extends React.Component ({ - fees: { - ...state.fees, - miner: newMinerFee, - service: new BigNumber(adminFeeSize).dp(currentDecimals, BigNumber.ROUND_CEIL), - total: newMinerFee.plus(adminFeeSize).dp(currentDecimals, BigNumber.ROUND_CEIL), - adminFeeSize: new BigNumber(adminFeeSize), - }, - })) - this.setAlowedBalances() + if (this.mounted) { + this.setState((state) => ({ + fees: { + ...state.fees, + miner: newMinerFee, + service: new BigNumber(adminFeeSize).dp(currentDecimals, BigNumber.ROUND_CEIL), + total: newMinerFee.plus(adminFeeSize).dp(currentDecimals, BigNumber.ROUND_CEIL), + adminFeeSize: new BigNumber(adminFeeSize), + }, + })) + this.setAllowedBalances() + } } catch (error) { this.reportError(error) } finally { @@ -533,7 +536,7 @@ class WithdrawModal extends React.Component ({ + isShipped: false + })) + } if (onReady instanceof Function) { onReady() @@ -565,11 +570,6 @@ class WithdrawModal extends React.Component ({ - isShipped: false, - })) + + if (this.mounted) { + this.setState(() => ({ + isShipped: false + })) + } }) } @@ -653,10 +656,8 @@ class WithdrawModal extends React.Component { - const { openScanCam } = this.state - - this.setState(() => ({ - openScanCam: !openScanCam, + this.setState((state) => ({ + openScanCam: !state.openScanCam, })) } @@ -669,7 +670,7 @@ class WithdrawModal extends React.Component void' is not assignable to parameter of type Transform + handleAmount = (value): any => { const { selectedCurrency, @@ -682,8 +683,10 @@ class WithdrawModal extends React.Component { this.fetchBtcFee() }, 2000) @@ -725,7 +728,7 @@ class WithdrawModal extends React.Component { + setAllowedBalances = () => { const { selectedItem, usedAdminFee, @@ -851,7 +854,7 @@ class WithdrawModal extends React.Component {/* why style ? see tip for max button */}
- {criptoCurrencyHaveInfoPrice && <> + {cryptoCurrencyHaveInfoPrice && <> {/* why style ? see tip for max button */}

- {new BigNumber(amount).isGreaterThan(0) && criptoCurrencyHaveInfoPrice && ( + {new BigNumber(amount).isGreaterThan(0) && cryptoCurrencyHaveInfoPrice && (

{!isMobile && ( - //@ts-ignore: strictNullChecks )} {dashboardView && ( - <> -
- -
- +
+ +
)} ) diff --git a/src/front/shared/components/notification/NotificationConductor/NotificationConductor.tsx b/src/front/shared/components/notification/NotificationConductor/NotificationConductor.tsx index ebaefbd07a..08764a3cea 100644 --- a/src/front/shared/components/notification/NotificationConductor/NotificationConductor.tsx +++ b/src/front/shared/components/notification/NotificationConductor/NotificationConductor.tsx @@ -27,11 +27,11 @@ export default class NotificationConductor extends Component { return areNotificationsExist && (
{ - notificationNames.map((key) => { + notificationNames.map((key, index) => { const { name, data = {} } = notifications[key] return React.createElement(Notifications[name], { - key: name, + key: index, name, data, history, diff --git a/src/front/shared/components/ui/DropDown/index.tsx b/src/front/shared/components/ui/DropDown/index.tsx index 94f34630c4..e3b51dd448 100644 --- a/src/front/shared/components/ui/DropDown/index.tsx +++ b/src/front/shared/components/ui/DropDown/index.tsx @@ -56,12 +56,6 @@ export default class DropDown extends Component { })) } - toggle = () => { - this.setState((state) => ({ - optionToggleIsOpen: !state.optionToggleIsOpen, - })) - } - handleOptionClick = (item) => { const { onSelect } = this.props diff --git a/src/front/shared/helpers/seo.ts b/src/front/shared/helpers/seo.ts index ff8d0382ce..671ebbd52e 100644 --- a/src/front/shared/helpers/seo.ts +++ b/src/front/shared/helpers/seo.ts @@ -6,7 +6,7 @@ const seo = { telegram: 'https://t.me/swaponline', email: 'info@swaponline.io', mainUrl: 'https://swaponline.io', - logo: 'https://screenshots.wpmix.net/chrome_2019-03-28_18-55-506746c4c5-44e6-4bb5-89cb-52ce8fabcedf.png', + logo: 'https://wiki.swaponline.io/assets/swaponline_io.svg', }, pages: [ { diff --git a/src/front/shared/helpers/transactions.ts b/src/front/shared/helpers/transactions.ts index 5c558d3bb3..3ea498f80a 100644 --- a/src/front/shared/helpers/transactions.ts +++ b/src/front/shared/helpers/transactions.ts @@ -2,7 +2,6 @@ import { BASE_TOKEN_CURRENCY } from 'swap.app/constants/COINS' import erc20Like from 'common/erc20Like' import helpers from 'helpers' import actions from 'redux/actions' -import apiLooper from 'helpers/apiLooper' const getTokenBaseCurrency = (tokenKey) => { const baseCurrencyRegExp = /^\{[a-z]+\}/ @@ -20,49 +19,6 @@ const getTokenBaseCurrency = (tokenKey) => { return false } -/** - * Запрашивает информацию о tx (final balances) - */ -const fetchTxBalances = (currency, txId) => { - const curName = helpers.getCurrencyKey(currency, true) - return apiLooper.get('txinfo', `/tx/${curName}/${txId}`, { - checkStatus: (res) => { - try { - if (res && res.answer !== undefined) return true - } catch (e) { /* */ } - return false - }, - }).then((res: any) => { - if (res - && res.answer - && res.answer === 'ok' - && res.data - ) { - return res.data - } - return false - - }).catch((e) => false) -} - -/** - * Сохраняет информацию о балансах на момент выполнения транзакции на backend - */ -const pullTxBalances = (txId, amount, balances, adminFee) => apiLooper.post('txinfo', `/pull`, { - body: { - txId, - amount, - adminFee, - ...balances, - }, - checkStatus: (res) => { - try { - if (res && res.answer !== undefined) return true - } catch (e) { /* */ } - return false - }, -}).then(({ answer }) => answer).catch((e) => false) - const getTxRouter = (currency, txHash) => { if (erc20Like.isToken({ name: currency })) { return `/token/${currency}/tx/${txHash}` @@ -128,7 +84,5 @@ export default { getInfo, getLink, getTxRouter, - pullTxBalances, - fetchTxBalances, getTokenBaseCurrency, } diff --git a/src/front/shared/components/modals/InfoInvoice/images/cancel.svg b/src/front/shared/images/cancelled.svg similarity index 100% rename from src/front/shared/components/modals/InfoInvoice/images/cancel.svg rename to src/front/shared/images/cancelled.svg diff --git a/src/front/shared/images/index.ts b/src/front/shared/images/index.ts index 766c055970..c505f8dab6 100644 --- a/src/front/shared/images/index.ts +++ b/src/front/shared/images/index.ts @@ -7,11 +7,15 @@ import iconTrustWallet from './trust.svg' import iconClose from './close.svg' import iconOk from './ok.svg' import iconChecked from './checked.svg' +import iconCancelled from './cancelled.svg' +import iconPending from './pending.svg' export const regularIcons = { CLOSE: iconClose, OK: iconOk, CHECKED: iconChecked, + CANCELLED: iconCancelled, + PENDING: iconPending, } const web3Icons = { diff --git a/src/front/shared/components/modals/InfoInvoice/images/pending.svg b/src/front/shared/images/pending.svg similarity index 100% rename from src/front/shared/components/modals/InfoInvoice/images/pending.svg rename to src/front/shared/images/pending.svg diff --git a/src/front/shared/pages/CurrencyWallet/CurrencyWallet.tsx b/src/front/shared/pages/CurrencyWallet/CurrencyWallet.tsx index 00142f6784..7837023627 100644 --- a/src/front/shared/pages/CurrencyWallet/CurrencyWallet.tsx +++ b/src/front/shared/pages/CurrencyWallet/CurrencyWallet.tsx @@ -57,7 +57,7 @@ const isWidgetBuild = config && config.isWidget @withRouter @CSSModules({ ...styles, ...stylesHere }, { allowMultiple: true }) class CurrencyWallet extends Component { - _mounted = false + mounted = false constructor(props) { super(props) @@ -116,7 +116,7 @@ class CurrencyWallet extends Component { } componentDidMount() { - this._mounted = true + this.mounted = true const { currency, @@ -132,7 +132,10 @@ class CurrencyWallet extends Component { let { match: { - params: { address = null }, + params: { + address = null, + action, + }, }, activeCurrency, activeFiat @@ -148,7 +151,9 @@ class CurrencyWallet extends Component { .then((balance) => this.setState({ balance })) } - actions.history.setTransactions(address, ticker.toLowerCase()) + if (action !== 'send') { + actions.history.setTransactions(address, ticker.toLowerCase()) + } if (!address) { actions.core.getSwapHistory() @@ -206,7 +211,7 @@ class CurrencyWallet extends Component { this.updateTransactions() } - if (address && prevAddress !== address) { + if (action !== 'send' && address && prevAddress !== address) { actions.history.setTransactions(address, currency.toLowerCase()) } @@ -241,6 +246,8 @@ class CurrencyWallet extends Component { const hasCachedData = lsDataCache.get(`TxHistory_${getCurrencyKey(currency, true).toLowerCase()}_${address}`) + if (!this.mounted) return + this.setState( { itemCurrency, @@ -290,7 +297,7 @@ class CurrencyWallet extends Component { } componentWillUnmount() { - this._mounted = false + this.mounted = false } filterCurrencies = (params) => { @@ -324,7 +331,7 @@ class CurrencyWallet extends Component { } updateTransactions = () => { - if (!this._mounted) return + if (!this.mounted) return const { txHistory } = this.props const { currency, address } = this.state @@ -524,32 +531,24 @@ class CurrencyWallet extends Component { - : - - {/* - //@ts-ignore */} - - + } >
@@ -568,15 +567,11 @@ class CurrencyWallet extends Component { ) : (
- {/* - //@ts-ignore */}
))} {(!txHistory || isLoading) && (
- {/* - //@ts-ignore */}
)} diff --git a/src/front/shared/pages/Exchange/AtomicSwap.tsx b/src/front/shared/pages/Exchange/AtomicSwap.tsx index 01dd628678..b85126156d 100644 --- a/src/front/shared/pages/Exchange/AtomicSwap.tsx +++ b/src/front/shared/pages/Exchange/AtomicSwap.tsx @@ -1708,11 +1708,11 @@ class Exchange extends PureComponent { return } - let balanceTooltip = null + let balanceTooltip: JSX.Element | null = null if (pairFees && pairFees.byCoins) { const sellCoinFee = pairFees.byCoins[sellCoin] || false - //@ts-ignore: strictNullChecks + balanceTooltip = (

{new BigNumber(balance).toNumber() === 0 || @@ -2038,7 +2038,6 @@ class Exchange extends PureComponent {

{' '} - {/* eslint-disable-line */} { link: ( {' '} - {/* eslint-disable-line */} - - diff --git a/src/front/shared/pages/Exchange/Orders/MyOrders/RowFeeds/images/arrow-right.svg b/src/front/shared/pages/Exchange/Orders/MyOrders/RowFeeds/images/arrow-right.svg deleted file mode 100644 index b0a4d2d2c4..0000000000 --- a/src/front/shared/pages/Exchange/Orders/MyOrders/RowFeeds/images/arrow-right.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/front/shared/pages/Exchange/images/swapIcon.svg b/src/front/shared/pages/Exchange/images/swapIcon.svg deleted file mode 100755 index b380f8d46d..0000000000 --- a/src/front/shared/pages/Exchange/images/swapIcon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/front/shared/pages/History/Filter/Filter.tsx b/src/front/shared/pages/History/Filter/Filter.tsx index d47ed8bebc..8ea0cc4b16 100644 --- a/src/front/shared/pages/History/Filter/Filter.tsx +++ b/src/front/shared/pages/History/Filter/Filter.tsx @@ -1,6 +1,3 @@ -import React from 'react' -import PropTypes from 'prop-types' - import actions from 'redux/actions/index' import { connect } from 'redaction' @@ -8,24 +5,26 @@ import CSSModules from 'react-css-modules' import styles from './Filter.scss' import FilterLink from './FilterLink/FilterLink' -import { FormattedMessage } from 'react-intl' +type ComponentProps = { + filter: string +} const filters = ['All', 'Sent', 'Received'] -const Filter = ({ filter }) => { +const Filter = (props: ComponentProps) => { + const { filter } = props const handleChangeFilter = (filter) => { actions.filter.setFilter(filter) - // actions.analytics.dataEvent(`history-click-${filter}`) } return (

{ - filters.map(item => ( + filters.map((item, index) => ( handleChangeFilter(item.toLowerCase())} filter={filter} @@ -36,10 +35,6 @@ const Filter = ({ filter }) => { ) } -Filter.propTypes = { - filter: PropTypes.string.isRequired, -} - export default connect(({ history: { filter } }) => ({ filter, }))(CSSModules(Filter, styles)) diff --git a/src/front/shared/pages/History/Row/Row.scss b/src/front/shared/pages/History/Row/Row.scss index 21694cfccd..9780ef0a7d 100644 --- a/src/front/shared/pages/History/Row/Row.scss +++ b/src/front/shared/pages/History/Row/Row.scss @@ -165,7 +165,7 @@ .invoiceContactWrapper { font-size: 0.9em; margin-top: 0.2em; - + color: var(--color); .contact { color: var(--color-notice); @@ -179,6 +179,7 @@ align-items: center; justify-content: space-between; margin-top: 4px; + color: var(--color); .requests { margin-left: 0.4em; diff --git a/src/front/shared/pages/History/Row/Row.tsx b/src/front/shared/pages/History/Row/Row.tsx index 6b77cdccd7..d603630ce6 100644 --- a/src/front/shared/pages/History/Row/Row.tsx +++ b/src/front/shared/pages/History/Row/Row.tsx @@ -178,16 +178,15 @@ export default class Row extends PureComponent { tokenPart, name, hash, - tokenBaseCurrency, } = params - if (erc20Like.isToken({ name }) && tokenBaseCurrency) { + if (erc20Like.isToken({ name })) { // react router doesn't rewrite url // it fix problem with token transaction info url if (location.pathname.includes(tokenPart)) { targetPath = `tx/${hash}` } else { - targetPath = `token/{${tokenBaseCurrency}}${name}/tx/${hash}` + targetPath = `token/${name}/tx/${hash}` } } @@ -305,7 +304,6 @@ export default class Row extends PureComponent { tokenPart: `token/{${tokenBaseCurrency}}${type}/`, name: tokenBaseCurrency ? `{${tokenBaseCurrency}}${type}` : type, hash: hash, - tokenBaseCurrency, })} > {(txType === 'CONFIRM') ? ( diff --git a/src/front/shared/pages/Wallet/WallerSlider/index.tsx b/src/front/shared/pages/Wallet/WallerSlider/index.tsx index 4a8e86ebd4..5edeec8718 100644 --- a/src/front/shared/pages/Wallet/WallerSlider/index.tsx +++ b/src/front/shared/pages/Wallet/WallerSlider/index.tsx @@ -236,8 +236,8 @@ class WallerSlider extends React.Component )} {banners && banners.length > 0 && - banners.map((banner) => ( -
+ banners.map((banner, index) => ( +
- - diff --git a/src/front/shared/pages/Wallet/images/dollar.svg b/src/front/shared/pages/Wallet/images/dollar.svg deleted file mode 100644 index a91a22283f..0000000000 --- a/src/front/shared/pages/Wallet/images/dollar.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/front/shared/pages/Wallet/images/pen.svg b/src/front/shared/pages/Wallet/images/pen.svg deleted file mode 100644 index 5bd1a908fa..0000000000 --- a/src/front/shared/pages/Wallet/images/pen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/front/shared/redux/actions/ethLikeAction.ts b/src/front/shared/redux/actions/ethLikeAction.ts index e7920a675a..5b2f0635ef 100644 --- a/src/front/shared/redux/actions/ethLikeAction.ts +++ b/src/front/shared/redux/actions/ethLikeAction.ts @@ -423,7 +423,16 @@ class EthLikeAction { return new Promise((res, rej) => { const receipt = sendMethod(txData) - .on('transactionHash', (hash) => !waitReceipt && res({ transactionHash: hash })) + .on('transactionHash', (hash) => { + reducers.transactions.addTransactionToQueue({ + networkCoin: this.ticker, + hash, + }) + + if (!waitReceipt) { + res({ transactionHash: hash }) + } + }) .on('receipt', (receipt) => waitReceipt && res(receipt)) .on('error', (error) => rej(error)) @@ -487,11 +496,11 @@ class EthLikeAction { txData.gas = defaultgasLimit } - return this.sendReadyTransaction({ data: txData }) + return this.sendReadyTransaction({ data: txData, toAdmin: true }) } sendReadyTransaction = async (params) => { - let { data, waitReceipt = false } = params + let { data, waitReceipt = false, toAdmin = false } = params const Web3 = this.getCurrentWeb3() const ownerAddress = metamask.isConnected() ? metamask.getAddress() @@ -522,10 +531,12 @@ class EthLikeAction { console.log(hash) console.groupEnd() - reducers.transactions.addTransactionToQueue({ - networkCoin: this.ticker, - hash, - }) + if (!toAdmin) { + reducers.transactions.addTransactionToQueue({ + networkCoin: this.ticker, + hash, + }) + } if (!waitReceipt) res(hash) }) diff --git a/src/front/shared/redux/actions/history.ts b/src/front/shared/redux/actions/history.ts index ada40952bb..9fe7eba160 100644 --- a/src/front/shared/redux/actions/history.ts +++ b/src/front/shared/redux/actions/history.ts @@ -24,6 +24,13 @@ const pullTransactions = (transactions) => { const setTransactions = async (address, type) => { let actionName + switch (type) { + case 'btc (sms-protected)': + case 'btc (multisig)': + case 'btc (pin-protected)': + type = 'btc' + } + if (erc20Like.isToken({name: type})) { const tokenStandard = COIN_DATA[type.toUpperCase()].standard.toLowerCase() actionName = tokenStandard diff --git a/src/front/shared/redux/actions/user.ts b/src/front/shared/redux/actions/user.ts index f6183ea938..8df2947124 100644 --- a/src/front/shared/redux/actions/user.ts +++ b/src/front/shared/redux/actions/user.ts @@ -259,24 +259,15 @@ const getExchangeRate = (sellCurrency, buyCurrency): Promise => { } const customTokenExchangeRate = (name) => { - let customRate = '' - - outsideLabel: { - for (const key in TOKEN_STANDARDS) { - const standard = TOKEN_STANDARDS[key].standard - - for (const tokenName in config[standard]) { - const exRate = config[standard][tokenName].customExchangeRate + for (const key in TOKEN_STANDARDS) { + const standard = TOKEN_STANDARDS[key].standard - if (tokenName === name && exRate) { - customRate = exRate - break outsideLabel - } - } + if (config[standard][name.toLowerCase()]) { + return config[standard][name.toLowerCase()].customExchangeRate || '' } } - return customRate + return '' } const getInfoAboutCurrency = (currencyNames) => {