diff --git a/app/reducers/info.js b/app/reducers/info.js index 1d37f6af..9d9b64c0 100644 --- a/app/reducers/info.js +++ b/app/reducers/info.js @@ -39,11 +39,13 @@ export const receiveInfo = (event, data) => (dispatch) => { const networks = { testnet: { explorerUrl: 'https://testnet.smartbit.com.au', - bitcoinJsNetwork: bitcoin.networks.testnet + bitcoinJsNetwork: bitcoin.networks.testnet, + unitPrefix: 't' }, mainnet: { explorerUrl: 'https://smartbit.com.au', - bitcoinJsNetwork: bitcoin.networks.bitcoin + bitcoinJsNetwork: bitcoin.networks.bitcoin, + unitPrefix: '' } } // IPC info fetch failed diff --git a/app/reducers/ticker.js b/app/reducers/ticker.js index 4069643a..cc59e033 100644 --- a/app/reducers/ticker.js +++ b/app/reducers/ticker.js @@ -1,5 +1,7 @@ import { createSelector } from 'reselect' import { requestTickers } from '../api' +import { infoSelectors } from './info' + // ------------------------------------ // Constants // ------------------------------------ @@ -97,11 +99,13 @@ tickerSelectors.currentCurrencyFilters = createSelector( tickerSelectors.currencyName = createSelector( currencySelector, - (currency) => { - if (currency === 'btc') { return 'BTC' } - if (currency === 'sats') { return 'satoshis' } + infoSelectors.networkSelector, + (currency, network) => { + let unit = currency + if (currency === 'btc') { unit = 'BTC' } + if (currency === 'sats') { unit = 'satoshis' } - return currency + return `${network.unitPrefix}${unit}` } ) diff --git a/test/reducers/__snapshots__/info.spec.js.snap b/test/reducers/__snapshots__/info.spec.js.snap index 5f512a96..51494c79 100644 --- a/test/reducers/__snapshots__/info.spec.js.snap +++ b/test/reducers/__snapshots__/info.spec.js.snap @@ -27,6 +27,7 @@ Object { "wif": 128, }, "explorerUrl": "https://smartbit.com.au", + "unitPrefix": "", }, "showWalletCurrencyFilters": false, }