From 4982c3e3d1d947867cf61fe1a3027f12daebe1f1 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Thu, 21 Feb 2019 15:18:08 +0100 Subject: [PATCH 1/6] LL-1063 Account for terminated cryptos --- src/components/CurrenciesStatusBanner.js | 14 +++++++++++++- src/components/ManagerPage/AppsList.js | 7 ++++++- src/config/cryptocurrencies.js | 10 ++++++---- static/i18n/en/app.json | 3 ++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/CurrenciesStatusBanner.js b/src/components/CurrenciesStatusBanner.js index 2138f73d..fb29a1f0 100644 --- a/src/components/CurrenciesStatusBanner.js +++ b/src/components/CurrenciesStatusBanner.js @@ -15,6 +15,7 @@ import IconCross from 'icons/Cross' import IconTriangleWarning from 'icons/TriangleWarning' import IconChevronRight from 'icons/ChevronRight' +import { listCryptoCurrencies } from 'config/cryptocurrencies' import { dismissedBannersSelector } from 'reducers/settings' import { currenciesStatusSelector, fetchCurrenciesStatus } from 'reducers/currenciesStatus' import { currenciesSelector } from 'reducers/accounts' @@ -92,11 +93,22 @@ class CurrenciesStatusBanner extends PureComponent { render() { const { dismissedBanners, accountsCurrencies, currenciesStatus, t } = this.props - const filtered = currenciesStatus.filter( + + const currenciesStatusWithTerminated = currenciesStatus.concat( + listCryptoCurrencies(true, true).map(coin => ({ + id: coin.id, + nonce: 98, + message: t('banners.genericTerminatedCrypto', { coinName: coin.name }), + link: coin.terminated && coin.terminated.link || "#", + })), + ) + + const filtered = currenciesStatusWithTerminated.filter( item => accountsCurrencies.find(cur => cur.id === item.id) && dismissedBanners.indexOf(getItemKey(item)) === -1, ) + if (!filtered.length) return null return ( diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index d2935f46..7f8267c7 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -9,8 +9,10 @@ import { compose } from 'redux' import type { Device, T } from 'types/common' import type { ApplicationVersion, DeviceInfo } from '@ledgerhq/live-common/lib/types/manager' +import type { CryptoCurrency } from '@ledgerhq/live-common/lib/types/currencies' import manager from '@ledgerhq/live-common/lib/manager' import { getFullListSortedCryptoCurrencies } from 'helpers/countervalues' +import { listCryptoCurrencies } from 'config/cryptocurrencies' import { developerModeSelector } from 'reducers/settings' import installApp from 'commands/installApp' import uninstallApp from 'commands/uninstallApp' @@ -89,7 +91,10 @@ type State = { } const oldAppsInstallDisabled = ['ZenCash', 'Ripple'] -const canHandleInstall = c => !oldAppsInstallDisabled.includes(c.name) +const terminatedCryptoCurrencies: Array = listCryptoCurrencies(true, true) +const canHandleInstall = app => + !oldAppsInstallDisabled.includes(app.name) && + !terminatedCryptoCurrencies.some(coin => coin.managerAppName === app.name) const LoadingApp = () => ( diff --git a/src/config/cryptocurrencies.js b/src/config/cryptocurrencies.js index 4c29f7b3..a38a90c1 100644 --- a/src/config/cryptocurrencies.js +++ b/src/config/cryptocurrencies.js @@ -32,8 +32,10 @@ const supported: CryptoCurrencyIds[] = [ 'bitcoin_testnet', ] -export const listCryptoCurrencies = memoize((withDevCrypto?: boolean) => - listCC(withDevCrypto) - .filter(c => supported.includes(c.id)) - .sort((a, b) => a.name.localeCompare(b.name)), +export const listCryptoCurrencies = memoize( + (withDevCrypto?: boolean, onlyTerminated?: boolean = false) => + listCC(withDevCrypto) + .filter(c => supported.includes(c.id)) + .filter(c => (onlyTerminated ? c.terminated : !c.terminated)) + .sort((a, b) => a.name.localeCompare(b.name)), ) diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 9aed68e6..cdfb36c2 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -112,7 +112,8 @@ } }, "banners": { - "promoteMobile": "Enjoy the Ledger Live experience, now available on mobile with the Ledger Nano X" + "promoteMobile": "Enjoy the Ledger Live experience, now available on mobile with the Ledger Nano X", + "genericTerminatedCrypto": "{{coinName}} has been terminated" }, "dashboard": { "title": "Portfolio", From 27daf8709300d548e525ceb2921ba939e8c11ac6 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Thu, 21 Feb 2019 15:55:03 +0100 Subject: [PATCH 2/6] Added a resolver to the memoization to account for the second param --- src/components/CurrenciesStatusBanner.js | 2 +- src/config/cryptocurrencies.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/CurrenciesStatusBanner.js b/src/components/CurrenciesStatusBanner.js index fb29a1f0..2d0b72fd 100644 --- a/src/components/CurrenciesStatusBanner.js +++ b/src/components/CurrenciesStatusBanner.js @@ -99,7 +99,7 @@ class CurrenciesStatusBanner extends PureComponent { id: coin.id, nonce: 98, message: t('banners.genericTerminatedCrypto', { coinName: coin.name }), - link: coin.terminated && coin.terminated.link || "#", + link: (coin.terminated && coin.terminated.link) || '#', })), ) diff --git a/src/config/cryptocurrencies.js b/src/config/cryptocurrencies.js index a38a90c1..28706048 100644 --- a/src/config/cryptocurrencies.js +++ b/src/config/cryptocurrencies.js @@ -38,4 +38,5 @@ export const listCryptoCurrencies = memoize( .filter(c => supported.includes(c.id)) .filter(c => (onlyTerminated ? c.terminated : !c.terminated)) .sort((a, b) => a.name.localeCompare(b.name)), + (a?: boolean, b?: boolean) => `${a ? 1 : 0}_${b ? 1 : 0}`, ) From 9fc7ac8759488c5ba4e6ff1996e16965ecbdb51a Mon Sep 17 00:00:00 2001 From: David da Silva Rosa <712580+dasilvarosa@users.noreply.github.com> Date: Thu, 21 Feb 2019 16:17:02 +0100 Subject: [PATCH 3/6] Update app.json --- static/i18n/en/app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index cdfb36c2..f9f194cd 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -113,7 +113,7 @@ }, "banners": { "promoteMobile": "Enjoy the Ledger Live experience, now available on mobile with the Ledger Nano X", - "genericTerminatedCrypto": "{{coinName}} has been terminated" + "genericTerminatedCrypto": "{{coinName}} is not supported anymore" }, "dashboard": { "title": "Portfolio", From 5234b33cc0f4d8e3eda3fbd3425239725476e182 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Thu, 21 Feb 2019 22:33:21 +0100 Subject: [PATCH 4/6] Version bump for live-common to allow testing --- package.json | 2 +- yarn.lock | 119 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 5a256f90..1dd1fdb9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@ledgerhq/hw-transport": "^4.35.0", "@ledgerhq/hw-transport-node-hid": "^4.35.0", "@ledgerhq/ledger-core": "2.0.0-rc.16", - "@ledgerhq/live-common": "4.16.1", + "@ledgerhq/live-common": "4.20.0", "animated": "^0.2.2", "async": "^2.6.1", "axios": "^0.18.0", diff --git a/yarn.lock b/yarn.lock index 3ed0695a..5e1b203b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1677,32 +1677,39 @@ camelcase "^5.0.0" prettier "^1.13.7" -"@ledgerhq/errors@^4.32.0", "@ledgerhq/errors@^4.39.0": +"@ledgerhq/devices@^4.39.0": + version "4.39.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-4.39.0.tgz#47d23a1a58004da162e007e0c456ab2119038c7d" + integrity sha512-2Jd7CVvMJDZxxaSpQpfOMeGWf7M0f6nZqZQWfjsUDQHw45Kunck101pXr6U/5UejJiLl/fhyLqvaXz0X0cs+1A== + dependencies: + "@ledgerhq/errors" "^4.39.0" + +"@ledgerhq/errors@^4.39.0": version "4.39.0" resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-4.39.0.tgz#10b9889f78df94ce36a4b34d9a3a45aac77be0e9" integrity sha512-kBr2rnoYDACRCxTLtEufE4oCvYj6vx2oFWVVjwskBxYsF5LC9R8Mbg5C4GgvDweiWW4Io8HA9p9jCsOfdCDygg== -"@ledgerhq/hw-app-btc@^4.32.0", "@ledgerhq/hw-app-btc@^4.35.0": - version "4.35.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.35.0.tgz#aafd655c988da39f774b0a4706e7f8897222f414" - integrity sha512-oX9YcQAuU+rOJm/lE7YF5+JXNppHcUv23ZltGz5CbWHnhm7Tqo4MOR8N5oSnHKlHW+IawfWCPN5PqdF7RGyQ5w== +"@ledgerhq/hw-app-btc@^4.35.0", "@ledgerhq/hw-app-btc@^4.39.0": + version "4.39.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.39.0.tgz#5b564e683a43a50002579834ec54aa790fde35f1" + integrity sha512-xPOtoIgsErycMFTKHb0yHLqlKn0C+9msLBsA1zRPNsWMdxEEBO5pzFVmn5ha1j3q/73yeICHlcB4KZcTb7CShA== dependencies: - "@ledgerhq/hw-transport" "^4.35.0" + "@ledgerhq/hw-transport" "^4.39.0" create-hash "^1.1.3" -"@ledgerhq/hw-app-eth@^4.32.0", "@ledgerhq/hw-app-eth@^4.35.0": - version "4.35.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.35.0.tgz#3a8c1b0db87224a24ff5441a0e819122e5585f2d" - integrity sha512-MSDr8+CaoXhtm64ELuI/8wpcfmrMUjzGJgASY6bnjc82vAW+6sHNZlTU0zWRTZxqQUuZ8WpuJP159cf92MWq3g== +"@ledgerhq/hw-app-eth@^4.35.0", "@ledgerhq/hw-app-eth@^4.39.0": + version "4.39.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.39.0.tgz#3cbba1f1650665c4c29c7b9fa246cb2360495867" + integrity sha512-IKPcLTcGohh/S6Z1LaAfn2pGyxfT6xu958/xV+5H4a3Ej0CWKaxcno4FkhaxH4OiViF0F5SEFzxtH+UntH2jdg== dependencies: - "@ledgerhq/hw-transport" "^4.35.0" + "@ledgerhq/hw-transport" "^4.39.0" -"@ledgerhq/hw-app-xrp@^4.32.0", "@ledgerhq/hw-app-xrp@^4.35.0": - version "4.35.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-4.35.0.tgz#f6aec06ae53f8732d90f745963a2de96c2ffa432" - integrity sha512-kQLdr9xrYvkFR9+QVyTNtmSGFDfrQ63ac0QhWKEoILiiQ0dxfZ7qCCp/qPJk/sx9H8dMX37X6y+xAnSU1frbfg== +"@ledgerhq/hw-app-xrp@^4.35.0", "@ledgerhq/hw-app-xrp@^4.39.0": + version "4.39.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-4.39.0.tgz#cc399649f17873778e34bcde16f488faef3117e5" + integrity sha512-lbrG7AhQdJzt/zhu0G5yfC2t4zlytWuzbNLrPp/VQKJJPUKsC98H81pmfMzn1lFBdm8frmBVUW6reN5p7wDS2Q== dependencies: - "@ledgerhq/hw-transport" "^4.35.0" + "@ledgerhq/hw-transport" "^4.39.0" bip32-path "0.4.2" "@ledgerhq/hw-transport-node-hid@^4.35.0": @@ -1715,11 +1722,13 @@ node-hid "^0.7.2" usb "^1.3.3" -"@ledgerhq/hw-transport@^4.21.0", "@ledgerhq/hw-transport@^4.32.0", "@ledgerhq/hw-transport@^4.35.0": - version "4.35.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.35.0.tgz#aa7b851111ed759cd7489fa07a7b34c1773e8314" - integrity sha512-o8ekdoCkHMvOByIKDmAMNDjm8Q5cu+sbqmebPtGrHAPbgIZBUbNA5UupY/Om+xypdxXYnuBw+MF8FyIVOjnIsg== +"@ledgerhq/hw-transport@^4.21.0", "@ledgerhq/hw-transport@^4.35.0", "@ledgerhq/hw-transport@^4.39.0": + version "4.39.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.39.0.tgz#602c6ea3fef56d1df205274ea742b4cf85613f6c" + integrity sha512-XkVAy2SFRDdE3qQGGVxB7RQdsdIx1fcoRNReU7NQXK59fYqxue+ZoiGtynEoHq9RKMg8EBG2kBXSVEh1iPdOlA== dependencies: + "@ledgerhq/devices" "^4.39.0" + "@ledgerhq/errors" "^4.39.0" events "^3.0.0" "@ledgerhq/ledger-core@2.0.0-rc.16": @@ -1730,20 +1739,21 @@ bindings "^1.3.0" nan "^2.6.2" -"@ledgerhq/live-common@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.16.1.tgz#9b8d29bad5867f422566b51ba8ef262ba32a49ae" - integrity sha512-a0ckySEeCj+xnSr6zkbx2uFri3W+uHbEf0I5HIUjm7hXP4N36Rm8vPP+xR5oHpzIaj1DzpcFVDIBm9TgIhXwMA== +"@ledgerhq/live-common@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.20.0.tgz#034763f79a308245b0d7754341e0c9731e4d77c0" + integrity sha512-zOamSAo9kIVi7zmYAovDh7xDFOF9DThSQGtXmu25zIIPhGeAWPQo9rVvtDCV9CDHTjsPs5baN0qFSCHwFIM9Cw== dependencies: "@aeternity/ledger-app-api" "0.0.4" - "@ledgerhq/errors" "^4.32.0" - "@ledgerhq/hw-app-btc" "^4.32.0" - "@ledgerhq/hw-app-eth" "^4.32.0" - "@ledgerhq/hw-app-xrp" "^4.32.0" - "@ledgerhq/hw-transport" "^4.32.0" + "@ledgerhq/errors" "^4.39.0" + "@ledgerhq/hw-app-btc" "^4.39.0" + "@ledgerhq/hw-app-eth" "^4.39.0" + "@ledgerhq/hw-app-xrp" "^4.39.0" + "@ledgerhq/hw-transport" "^4.39.0" bignumber.js "^7.2.1" compressjs gre/compressjs#hermit eip55 "^1.0.3" + ethereumjs-tx "^1.3.7" invariant "^2.2.2" lodash "^4.17.4" numeral "^2.0.6" @@ -1753,6 +1763,10 @@ react-redux "^5.0.7" redux "^4.0.0" reselect "^3.0.1" + ripple-binary-codec "^0.2.0" + ripple-bs58check "^2.0.2" + ripple-hashes "^0.3.1" + ripple-lib "^1.1.2" rxjs "^6.3.3" rxjs-compat "^6.3.3" @@ -7435,6 +7449,14 @@ ethereumjs-tx@^1.3.4: ethereum-common "^0.0.18" ethereumjs-util "^5.0.0" +ethereumjs-tx@^1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" + integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== + dependencies: + ethereum-common "^0.0.18" + ethereumjs-util "^5.0.0" + ethereumjs-util@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" @@ -14209,6 +14231,19 @@ ripple-address-codec@^2.0.1: hash.js "^1.0.3" x-address-codec "^0.7.0" +ripple-binary-codec@0.2.0, ripple-binary-codec@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-0.2.0.tgz#cef049f671f398de255e5c190b9f6545c7c7c36f" + integrity sha512-qCf3syhtwPFq70JIh/7VSegynj5gWXVNI5T5I7dobqiNxY3fZQvOePRnchnN1OzC0jMh8x0b2ASmkvIlf259zQ== + dependencies: + babel-runtime "^6.6.1" + bn.js "^4.11.3" + create-hash "^1.1.2" + decimal.js "^5.0.8" + inherits "^2.0.1" + lodash "^4.12.0" + ripple-address-codec "^2.0.1" + ripple-binary-codec@^0.1.0, ripple-binary-codec@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-0.1.13.tgz#c68951405a17a71695551e789966ff376da552e4" @@ -14259,6 +14294,14 @@ ripple-keypairs@^0.10.1: hash.js "^1.0.3" ripple-address-codec "^2.0.1" +ripple-lib-transactionparser@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ripple-lib-transactionparser/-/ripple-lib-transactionparser-0.7.1.tgz#5ececb1e03d65d05605343f4b9dbb76d1089145b" + integrity sha1-Xs7LHgPWXQVgU0P0udu3bRCJFFs= + dependencies: + bignumber.js "^4.1.0" + lodash "^4.17.4" + ripple-lib-transactionparser@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/ripple-lib-transactionparser/-/ripple-lib-transactionparser-0.6.2.tgz#eb117834816cab3398445a74ec3cacec95b6b5fa" @@ -14285,6 +14328,24 @@ ripple-lib@^1.0.0-beta.0: ripple-lib-transactionparser "^0.6.2" ws "^3.3.1" +ripple-lib@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.1.2.tgz#e9cf21e7ac61c70c90dd0b105bacc561e5046f12" + integrity sha512-LPWsOi0trS1gcBKJpQPA9vDCn3IUfW0RYaWLLlELoNQY0MJUOG1e0J3qQlDrL+/gRW/MywlPtux5D+I4GiEVHw== + dependencies: + "@types/lodash" "^4.14.85" + "@types/ws" "^3.2.0" + bignumber.js "^4.1.0" + https-proxy-agent "2.2.1" + jsonschema "1.2.2" + lodash "^4.17.4" + ripple-address-codec "^2.0.1" + ripple-binary-codec "0.2.0" + ripple-hashes "^0.3.1" + ripple-keypairs "^0.10.1" + ripple-lib-transactionparser "0.7.1" + ws "^3.3.1" + rlp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.1.0.tgz#e4f9886d5a982174f314543831e36e1a658460f9" From 6dcc53b9506f77446667e59c3f47b6a3bba803ca Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Fri, 22 Feb 2019 13:52:10 +0100 Subject: [PATCH 5/6] Moves logic to currencieStatus selector, prevents continue on Send flow --- src/components/CurrenciesStatusBanner.js | 16 ++++---------- .../modals/Send/steps/01-step-amount.js | 10 ++++++++- src/reducers/currenciesStatus.js | 21 ++++++++++++++++++- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/components/CurrenciesStatusBanner.js b/src/components/CurrenciesStatusBanner.js index 2d0b72fd..a208f38f 100644 --- a/src/components/CurrenciesStatusBanner.js +++ b/src/components/CurrenciesStatusBanner.js @@ -15,7 +15,6 @@ import IconCross from 'icons/Cross' import IconTriangleWarning from 'icons/TriangleWarning' import IconChevronRight from 'icons/ChevronRight' -import { listCryptoCurrencies } from 'config/cryptocurrencies' import { dismissedBannersSelector } from 'reducers/settings' import { currenciesStatusSelector, fetchCurrenciesStatus } from 'reducers/currenciesStatus' import { currenciesSelector } from 'reducers/accounts' @@ -94,16 +93,7 @@ class CurrenciesStatusBanner extends PureComponent { render() { const { dismissedBanners, accountsCurrencies, currenciesStatus, t } = this.props - const currenciesStatusWithTerminated = currenciesStatus.concat( - listCryptoCurrencies(true, true).map(coin => ({ - id: coin.id, - nonce: 98, - message: t('banners.genericTerminatedCrypto', { coinName: coin.name }), - link: (coin.terminated && coin.terminated.link) || '#', - })), - ) - - const filtered = currenciesStatusWithTerminated.filter( + const filtered = currenciesStatus.filter( item => accountsCurrencies.find(cur => cur.id === item.id) && dismissedBanners.indexOf(getItemKey(item)) === -1, @@ -112,7 +102,9 @@ class CurrenciesStatusBanner extends PureComponent { if (!filtered.length) return null return ( - {filtered.map(r => )} + {filtered.map(r => ( + + ))} ) } diff --git a/src/components/modals/Send/steps/01-step-amount.js b/src/components/modals/Send/steps/01-step-amount.js index fd810e9c..4a973332 100644 --- a/src/components/modals/Send/steps/01-step-amount.js +++ b/src/components/modals/Send/steps/01-step-amount.js @@ -19,6 +19,7 @@ import RecipientField from '../fields/RecipientField' import AmountField from '../fields/AmountField' import type { StepProps } from '../index' +import { listCryptoCurrencies } from '../../../../config/cryptocurrencies' export default ({ t, @@ -154,6 +155,9 @@ export class StepAmountFooter extends PureComponent< render() { const { t, transitionTo, account } = this.props const { isSyncing, totalSpent, canNext } = this.state + const isTerminated = + account && listCryptoCurrencies(true, true).some(coin => coin.name === account.currency.name) + return ( @@ -190,7 +194,11 @@ export class StepAmountFooter extends PureComponent< {isSyncing && } - diff --git a/src/reducers/currenciesStatus.js b/src/reducers/currenciesStatus.js index b582fa87..b0a228a6 100644 --- a/src/reducers/currenciesStatus.js +++ b/src/reducers/currenciesStatus.js @@ -1,4 +1,5 @@ // @flow +import React from 'react' import { handleActions, createAction } from 'redux-actions' import { createSelector } from 'reselect' @@ -8,7 +9,9 @@ import network from 'api/network' import { urls } from 'config/urls' import logger from 'logger' +import { Trans } from 'react-i18next' import type { State } from './index' +import { listCryptoCurrencies } from '../config/cryptocurrencies' export type CurrencyStatus = { id: string, // the currency id @@ -39,8 +42,24 @@ export const fetchCurrenciesStatus = () => async (dispatch: *) => { method: 'GET', url: process.env.LL_STATUS_ENDPOINT || urls.currenciesStatus, }) + + const terminatedCurrencies = listCryptoCurrencies(true, true).map(coin => ({ + id: coin.id, + nonce: 98, + message: ( + + ), + link: (coin.terminated && coin.terminated.link) || '#', + })) + if (Array.isArray(data)) { - dispatch(setCurrenciesStatus(data)) + dispatch(setCurrenciesStatus(data.concat(terminatedCurrencies))) + } else { + setCurrenciesStatus(terminatedCurrencies) } } catch (err) { logger.error(err) From 66fc351cafbecae04a74ad3c928d0574e3da4344 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Fri, 22 Feb 2019 15:39:32 +0100 Subject: [PATCH 6/6] || not && --- src/components/modals/Send/steps/01-step-amount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/modals/Send/steps/01-step-amount.js b/src/components/modals/Send/steps/01-step-amount.js index 4a973332..feb239d1 100644 --- a/src/components/modals/Send/steps/01-step-amount.js +++ b/src/components/modals/Send/steps/01-step-amount.js @@ -195,7 +195,7 @@ export class StepAmountFooter extends PureComponent<