Browse Source

Fix countervalues for testnets

master
Gaëtan Renaudeau 7 years ago
parent
commit
dbcbe66c6a
  1. 2
      package.json
  2. 2
      src/helpers/countervalues.js
  3. 7
      src/reducers/settings.js
  4. 6
      yarn.lock

2
package.json

@ -42,7 +42,7 @@
"@ledgerhq/hw-transport": "^4.12.0",
"@ledgerhq/hw-transport-node-hid": "^4.12.0",
"@ledgerhq/ledger-core": "1.4.5",
"@ledgerhq/live-common": "2.27.1",
"@ledgerhq/live-common": "2.29.0",
"axios": "^0.18.0",
"babel-runtime": "^6.26.0",
"bcryptjs": "^2.4.3",

2
src/helpers/countervalues.js

@ -20,7 +20,7 @@ const pairsSelector = createSelector(
[
{ from: intermediaryCurrency, to: counterValueCurrency, exchange: counterValueExchange },
].concat(
currencies.filter(c => c !== intermediaryCurrency).map(currency => ({
currencies.filter(c => c.ticker !== intermediaryCurrency.ticker).map(currency => ({
from: currency,
to: intermediaryCurrency,
exchange: currencySettingsSelector(state, { currency }).exchange,

7
src/reducers/settings.js

@ -98,12 +98,15 @@ const handlers: Object = {
copy.currenciesSettings = { ...copy.currenciesSettings }
for (const { to, from, exchange } of pairs) {
const fromCrypto = asCryptoCurrency(from)
if (fromCrypto && to === intermediaryCurrency) {
if (fromCrypto && to.ticker === intermediaryCurrency.ticker) {
copy.currenciesSettings[fromCrypto.id] = {
...copy.currenciesSettings[fromCrypto.id],
exchange,
}
} else if (from === intermediaryCurrency && to === counterValueCurrency) {
} else if (
from.ticker === intermediaryCurrency.ticker &&
to.ticker === counterValueCurrency.ticker
) {
copy.counterValueExchange = exchange
}
}

6
yarn.lock

@ -1495,9 +1495,9 @@
npm "^5.7.1"
prebuild-install "^2.2.2"
"@ledgerhq/live-common@2.27.1":
version "2.27.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.27.1.tgz#3ea96eb80b3e2676529c805c76e6b20ce14b95f0"
"@ledgerhq/live-common@2.29.0":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.29.0.tgz#a8f8a023f12973a60b2f89882534597f0723929f"
dependencies:
axios "^0.18.0"
invariant "^2.2.2"

Loading…
Cancel
Save