From 915d2ae7d2afe611dc23ed062ca6eb23951c6bf4 Mon Sep 17 00:00:00 2001 From: Fred de Villamil Date: Wed, 22 Aug 2018 11:11:31 +0200 Subject: [PATCH] Revert "Master" --- package.json | 4 +- src/components/ExchangePage/index.js | 19 ---- src/components/QRCodeCameraPickerCanvas.js | 2 +- src/components/RecipientAddress/index.js | 4 +- .../AddAccounts/steps/04-step-finish.js | 2 +- .../modals/Send/fields/RecipientField.js | 34 ++----- src/config/errors.js | 1 - src/config/urls.js | 5 +- static/i18n/en/app.json | 7 +- static/i18n/en/errors.json | 3 - static/images/logos/exchanges/genesis.svg | 6 -- static/images/logos/exchanges/luno.svg | 14 --- static/images/logos/exchanges/shapeshift.svg | 93 ------------------- yarn.lock | 6 +- 14 files changed, 18 insertions(+), 182 deletions(-) delete mode 100644 static/images/logos/exchanges/genesis.svg delete mode 100644 static/images/logos/exchanges/luno.svg delete mode 100644 static/images/logos/exchanges/shapeshift.svg diff --git a/package.json b/package.json index eeeac8c0..6cea84ba 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "Ledger Live", "description": "Ledger Live - Desktop", "repository": "https://github.com/LedgerHQ/ledger-live-desktop", - "version": "1.1.7", + "version": "1.1.6", "author": "Ledger", "license": "MIT", "scripts": { @@ -39,7 +39,7 @@ "@ledgerhq/hw-transport": "^4.13.0", "@ledgerhq/hw-transport-node-hid": "4.22.0", "@ledgerhq/ledger-core": "2.0.0-rc.6", - "@ledgerhq/live-common": "3.0.2", + "@ledgerhq/live-common": "3.0.0", "animated": "^0.2.2", "async": "^2.6.1", "axios": "^0.18.0", diff --git a/src/components/ExchangePage/index.js b/src/components/ExchangePage/index.js index 9e612a78..6f40ae6c 100644 --- a/src/components/ExchangePage/index.js +++ b/src/components/ExchangePage/index.js @@ -5,7 +5,6 @@ import { translate } from 'react-i18next' import type { T } from 'types/common' import { urls } from 'config/urls' -import { i } from 'helpers/staticPath' import TrackPage from 'analytics/TrackPage' import Box from 'components/base/Box' @@ -52,24 +51,6 @@ const cards = [ url: urls.paybis, logo: , }, - { - key: 'luno', - id: 'luno', - url: urls.luno, - logo: Luno, - }, - { - key: 'shapeshift', - id: 'shapeshift', - url: urls.shapeshift, - logo: Shapeshift, - }, - { - key: 'genesis', - id: 'genesis', - url: urls.genesis, - logo: Genesis, - }, ] class ExchangePage extends PureComponent { diff --git a/src/components/QRCodeCameraPickerCanvas.js b/src/components/QRCodeCameraPickerCanvas.js index c4340e72..b2f6643e 100644 --- a/src/components/QRCodeCameraPickerCanvas.js +++ b/src/components/QRCodeCameraPickerCanvas.js @@ -155,7 +155,7 @@ export default class QRCodeCameraPickerCanvas extends Component< .catch(e => { if (this.unmounted) return this.setState({ - message: String(e.message || e.name || e), + message: String(e.message || e), }) }) } diff --git a/src/components/RecipientAddress/index.js b/src/components/RecipientAddress/index.js index e825d2d4..24f7895d 100644 --- a/src/components/RecipientAddress/index.js +++ b/src/components/RecipientAddress/index.js @@ -47,7 +47,7 @@ const BackgroundLayer = styled(Box)` type Props = { value: string, // return false if it can't be changed (invalid info) - onChange: (string, ?{ amount?: BigNumber, currency?: CryptoCurrency }) => Promise, + onChange: (string, ?{ amount?: BigNumber, currency?: CryptoCurrency }) => ?boolean, withQrCode: boolean, } @@ -76,8 +76,6 @@ class RecipientAddress extends PureComponent { handleOnPick = (code: string) => { const { address, ...rest } = decodeURIScheme(code) - // $FlowFixMe - Object.assign(rest, { fromQRCode: true }) if (this.props.onChange(address, rest) !== false) { this.setState({ qrReaderOpened: false }) } diff --git a/src/components/modals/AddAccounts/steps/04-step-finish.js b/src/components/modals/AddAccounts/steps/04-step-finish.js index 312c4aea..6170af8e 100644 --- a/src/components/modals/AddAccounts/steps/04-step-finish.js +++ b/src/components/modals/AddAccounts/steps/04-step-finish.js @@ -52,7 +52,7 @@ export default StepFinish export const StepFinishFooter = ({ onGoStep1, t }: StepProps) => ( - diff --git a/src/components/modals/Send/fields/RecipientField.js b/src/components/modals/Send/fields/RecipientField.js index f083cfa7..c037a150 100644 --- a/src/components/modals/Send/fields/RecipientField.js +++ b/src/components/modals/Send/fields/RecipientField.js @@ -9,8 +9,6 @@ import Box from 'components/base/Box' import LabelWithExternalIcon from 'components/base/LabelWithExternalIcon' import RecipientAddress from 'components/RecipientAddress' import { track } from 'analytics/segment' -import { createCustomErrorClass } from 'helpers/errors' -import { CantScanQRCode } from 'config/errors' import { InvalidAddress } from 'config/errors' type Props = { @@ -24,12 +22,11 @@ type Props = { class RecipientField extends Component< Props, - { isValid: boolean, warning: ?Error, QRCodeRefusedReason: ?Error }, + { isValid: boolean, warning: ?Error }, > { state = { isValid: true, warning: null, - QRCodeRefusedReason: null, } componentDidMount() { this.resync() @@ -44,9 +41,7 @@ class RecipientField extends Component< } componentWillUnmount() { this.syncId++ - this.isUnmounted = true } - isUnmounted = false syncId = 0 async resync() { const { account, bridge, transaction } = this.props @@ -55,31 +50,18 @@ class RecipientField extends Component< const isValid = await bridge.isRecipientValid(account.currency, recipient) const warning = await bridge.getRecipientWarning(account.currency, recipient) if (syncId !== this.syncId) return - if (this.isUnmounted) return this.setState({ isValid, warning }) } - onChange = async (recipient: string, maybeExtra: ?Object) => { + onChange = (recipient: string, maybeExtra: ?Object) => { const { bridge, account, transaction, onChangeTransaction } = this.props - const { QRCodeRefusedReason } = this.state - const { amount, currency, fromQRCode } = maybeExtra || {} + const { amount, currency } = maybeExtra || {} if (currency && currency.scheme !== account.currency.scheme) return false let t = transaction if (amount) { t = bridge.editTransactionAmount(account, t, amount) } - const warning = fromQRCode - ? await bridge.getRecipientWarning(account.currency, recipient) - : null - if (this.isUnmounted) return false - if (warning) { - // clear the input if field has warning AND has a warning - t = bridge.editTransactionRecipient(account, t, '') - this.setState({ QRCodeRefusedReason: new CantScanQRCode() }) - } else { - t = bridge.editTransactionRecipient(account, t, recipient) - if (QRCodeRefusedReason) this.setState({ QRCodeRefusedReason: null }) - } + t = bridge.editTransactionRecipient(account, t, recipient) onChangeTransaction(t) return true } @@ -90,13 +72,11 @@ class RecipientField extends Component< } render() { const { bridge, account, transaction, t, autoFocus } = this.props - const { isValid, warning, QRCodeRefusedReason } = this.state + const { isValid, warning } = this.state const value = bridge.getTransactionRecipient(account, transaction) const error = - !value || isValid - ? QRCodeRefusedReason - : new InvalidAddress(null, { currencyName: account.currency.name }) + !value || isValid ? null : new InvalidAddress(null, { currencyName: account.currency.name }) return ( @@ -106,7 +86,7 @@ class RecipientField extends Component< /> - - - - - diff --git a/static/images/logos/exchanges/luno.svg b/static/images/logos/exchanges/luno.svg deleted file mode 100644 index e2ee1781..00000000 --- a/static/images/logos/exchanges/luno.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/static/images/logos/exchanges/shapeshift.svg b/static/images/logos/exchanges/shapeshift.svg deleted file mode 100644 index 5efd76eb..00000000 --- a/static/images/logos/exchanges/shapeshift.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/yarn.lock b/yarn.lock index 23aa34ce..ff1b4421 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1542,9 +1542,9 @@ npm "^5.7.1" prebuild-install "^2.2.2" -"@ledgerhq/live-common@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-3.0.2.tgz#1ee5fcc6044c5a049c067978d81892f79789863c" +"@ledgerhq/live-common@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-3.0.0.tgz#abbd88e351c7d0ffffabf7e8502f5b2fbecdc150" dependencies: axios "^0.18.0" bignumber.js "^7.2.1"