From 05db6766f42c643a4963c5e3988aa42e515dadb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 10 Jul 2018 19:08:06 +0200 Subject: [PATCH] Fixes #948 cur.managerAppName for better precision in app to install --- src/components/AccountPage/EmptyStateAccount.js | 2 +- src/components/EnsureDeviceApp.js | 5 ++--- src/helpers/getAddressForCurrency/btc.js | 4 +--- static/i18n/en/app.yml | 4 +++- static/i18n/en/errors.yml | 5 +---- yarn.lock | 4 ++-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/components/AccountPage/EmptyStateAccount.js b/src/components/AccountPage/EmptyStateAccount.js index 98749e8f..bf8b672d 100644 --- a/src/components/AccountPage/EmptyStateAccount.js +++ b/src/components/AccountPage/EmptyStateAccount.js @@ -45,7 +45,7 @@ class EmptyStateAccount extends PureComponent { {'Make sure the'} - {account.currency.name} + {account.currency.managerAppName} {'app is installed to receive funds.'} diff --git a/src/components/EnsureDeviceApp.js b/src/components/EnsureDeviceApp.js index d001471d..75c11063 100644 --- a/src/components/EnsureDeviceApp.js +++ b/src/components/EnsureDeviceApp.js @@ -24,7 +24,6 @@ import type { Device } from 'types/common' import { createCustomErrorClass } from 'helpers/errors' import { getCurrentDevice } from 'reducers/devices' -export const WrongAppOpened = createCustomErrorClass('WrongAppOpened') export const WrongDeviceForAccount = createCustomErrorClass('WrongDeviceForAccount') const usbIcon = @@ -77,9 +76,9 @@ class EnsureDeviceApp extends Component<{ const cur = account ? account.currency : currency invariant(cur, 'No currency given') return ( - + {'Open the '} - {cur.name} + {cur.managerAppName} {' app on your device'} ) diff --git a/src/helpers/getAddressForCurrency/btc.js b/src/helpers/getAddressForCurrency/btc.js index 16fe52ac..f0ed669a 100644 --- a/src/helpers/getAddressForCurrency/btc.js +++ b/src/helpers/getAddressForCurrency/btc.js @@ -27,9 +27,7 @@ export default async ( if (bitcoinLikeInfo) { const { P2SH, P2PKH } = await getBitcoinLikeInfo(transport) if (P2SH !== bitcoinLikeInfo.P2SH || P2PKH !== bitcoinLikeInfo.P2PKH) { - throw new BtcUnmatchedApp(`BtcUnmatchedApp ${currency.id}`, { - currencyName: currency.name, - }) + throw new BtcUnmatchedApp(`BtcUnmatchedApp ${currency.id}`, currency) } } diff --git a/static/i18n/en/app.yml b/static/i18n/en/app.yml index 44e929ee..f26166ce 100644 --- a/static/i18n/en/app.yml +++ b/static/i18n/en/app.yml @@ -89,7 +89,7 @@ account: lastOperations: Last operations emptyState: title: No crypto assets yet? - desc: Make sure the <1><0>{{currency}} app is installed and start receiving + desc: Make sure the <1><0>{{managerAppName}} app is installed and start receiving buttons: receiveFunds: Receive settings: @@ -136,6 +136,8 @@ deviceConnect: choose: "We detected {{count}} connected devices, please select one:" connect: Connect and unlock your <1>Ledger device # remove key: <3>PIN code dashboard: Not used. # This key is not used. Still managed in JS. + step2: + open: 'Open the <1><0>{{managerAppName}} app on your device' emptyState: sidebar: text: Press this button to add accounts to your portfolio diff --git a/static/i18n/en/errors.yml b/static/i18n/en/errors.yml index 27cdc89d..fe0aee02 100644 --- a/static/i18n/en/errors.yml +++ b/static/i18n/en/errors.yml @@ -6,7 +6,7 @@ generic: # the error codes are alphabetically sorted BtcUnmatchedApp: title: That's the wrong app - description: Open the ‘{{currencyName}}’ app on your device + description: Open the ‘{{managerAppName}}’ app on your device DeviceNotGenuine: title: Possibly not genuine description: 'Request Ledger Support assistance.' @@ -94,9 +94,6 @@ WebsocketConnectionError: WebsocketConnectionFailed: title: Sorry, try again (websocket failed). description: -WrongAppOpened: - title: Please open the ‘{{currencyName}}’ app - description: The wrong app was opened on your device. Please retry. WrongDeviceForAccount: title: Oops, wrong device for ‘{{accountName}}’. description: The connected device is not associated with the account you selected. Please connect the right device. diff --git a/yarn.lock b/yarn.lock index 627089b7..0e40cc7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1535,8 +1535,8 @@ prebuild-install "^2.2.2" "@ledgerhq/live-common@^2.32.0": - version "2.33.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.33.0.tgz#07ea0244c6afb7892cf04b466ae23807aad8b509" + version "2.34.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.34.0.tgz#436ec0816c37f6aabcbca807090f152f1bd3b785" dependencies: axios "^0.18.0" invariant "^2.2.2"