Browse Source

fix countervalue for btc

master
Gaëtan Renaudeau 7 years ago
parent
commit
d51ddbf801
  1. 2
      package.json
  2. 5
      src/components/CalculateBalance.js
  3. 5
      src/components/CounterValue/index.js
  4. 4
      src/components/DashboardPage/AccountsOrder.js
  5. 4
      src/components/RequestAmount/index.js
  6. 2
      src/components/SettingsPage/sections/Currencies.js
  7. 6
      yarn.lock

2
package.json

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

5
src/components/CalculateBalance.js

@ -51,10 +51,7 @@ const mapStateToProps = (state: State, props: OwnProps) => {
originalValues.push(value) originalValues.push(value)
const fromExchange = exchangeSettingsForAccountSelector(state, { account }) const fromExchange = exchangeSettingsForAccountSelector(state, { account })
const cv = const cv = CounterValues.calculateWithIntermediarySelector(state, {
fromExchange &&
counterValueExchange &&
CounterValues.calculateWithIntermediarySelector(state, {
value, value,
date, date,
from: account.currency, from: account.currency,

5
src/components/CounterValue/index.js

@ -39,10 +39,7 @@ const mapStateToProps = (state: State, props: OwnProps) => {
const counterValueCurrency = counterValueCurrencySelector(state) const counterValueCurrency = counterValueCurrencySelector(state)
const fromExchange = currencySettingsSelector(state, { currency }).exchange const fromExchange = currencySettingsSelector(state, { currency }).exchange
const toExchange = counterValueExchangeSelector(state) const toExchange = counterValueExchangeSelector(state)
const counterValue = const counterValue = CounterValues.calculateWithIntermediarySelector(state, {
fromExchange &&
toExchange &&
CounterValues.calculateWithIntermediarySelector(state, {
from: currency, from: currency,
fromExchange, fromExchange,
intermediary: intermediaryCurrency, intermediary: intermediaryCurrency,

4
src/components/DashboardPage/AccountsOrder.js

@ -82,14 +82,12 @@ const accountsBtcBalanceSelector = createSelector(
accounts.map(account => { accounts.map(account => {
const { exchange } = currencySettingsForAccountSelector(state, { account }) const { exchange } = currencySettingsForAccountSelector(state, { account })
return ( return (
(exchange &&
CounterValues.calculateSelector(state, { CounterValues.calculateSelector(state, {
from: account.currency, from: account.currency,
to: intermediaryCurrency, to: intermediaryCurrency,
exchange, exchange,
value: account.balance, value: account.balance,
})) || }) || 0
0
) )
}), }),
) )

4
src/components/RequestAmount/index.js

@ -80,8 +80,6 @@ const mapStateToProps = (state: State, props: OwnProps) => {
const fromExchange = currencySettingsSelector(state, { currency }).exchange const fromExchange = currencySettingsSelector(state, { currency }).exchange
const toExchange = counterValueExchangeSelector(state) const toExchange = counterValueExchangeSelector(state)
const getCounterValue = value => const getCounterValue = value =>
fromExchange &&
toExchange &&
CounterValues.calculateWithIntermediarySelector(state, { CounterValues.calculateWithIntermediarySelector(state, {
from: currency, from: currency,
fromExchange, fromExchange,
@ -92,8 +90,6 @@ const mapStateToProps = (state: State, props: OwnProps) => {
}) })
const getReverseCounterValue = value => const getReverseCounterValue = value =>
fromExchange &&
toExchange &&
CounterValues.reverseWithIntermediarySelector(state, { CounterValues.reverseWithIntermediarySelector(state, {
from: currency, from: currency,
fromExchange, fromExchange,

2
src/components/SettingsPage/sections/Currencies.js

@ -110,6 +110,7 @@ class TabCurrencies extends PureComponent<Props, State> {
} }
/> />
<Body> <Body>
{currency !== intermediaryCurrency ? (
<Row <Row
title={`Exchange (${currency.ticker}${intermediaryCurrency.ticker})`} title={`Exchange (${currency.ticker}${intermediaryCurrency.ticker})`}
desc="The exchange to use" desc="The exchange to use"
@ -123,6 +124,7 @@ class TabCurrencies extends PureComponent<Props, State> {
minWidth={200} minWidth={200}
/> />
</Row> </Row>
) : null}
{defaults.confirmationsNb ? ( {defaults.confirmationsNb ? (
<Row <Row
title={t('settings:currencies.confirmationsNb')} title={t('settings:currencies.confirmationsNb')}

6
yarn.lock

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

Loading…
Cancel
Save