diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index f3ebb0cd..cf1233b5 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -256,6 +256,7 @@ const RippleJSBridge: WalletBridge = { const derivations = getDerivations(currency) for (const derivation of derivations) { + const legacy = derivation !== derivations[derivations.length - 1] for (let index = 0; index < 255; index++) { const freshAddressPath = derivation({ currency, x: index, segwit: false }) const { address, publicKey } = await await getAddress @@ -280,22 +281,24 @@ const RippleJSBridge: WalletBridge = { if (!info) { // account does not exist in Ripple server // we are generating a new account locally - next({ - id: accountId, - xpub: '', - name: getNewAccountPlaceholderName(currency, index), - freshAddress, - freshAddressPath, - balance: 0, - blockHeight: maxLedgerVersion, - index, - currency, - operations: [], - pendingOperations: [], - unit: currency.units[0], - archived: false, - lastSyncDate: new Date(), - }) + if (!legacy) { + next({ + id: accountId, + xpub: '', + name: getNewAccountPlaceholderName(currency, index), + freshAddress, + freshAddressPath, + balance: 0, + blockHeight: maxLedgerVersion, + index, + currency, + operations: [], + pendingOperations: [], + unit: currency.units[0], + archived: false, + lastSyncDate: new Date(), + }) + } break } @@ -315,7 +318,7 @@ const RippleJSBridge: WalletBridge = { const account: $Exact = { id: accountId, xpub: '', - name: getAccountPlaceholderName(currency, index), + name: getAccountPlaceholderName(currency, index, legacy), freshAddress, freshAddressPath, balance, diff --git a/src/components/OperationsList/index.js b/src/components/OperationsList/index.js index 92aacc4d..6fdcece6 100644 --- a/src/components/OperationsList/index.js +++ b/src/components/OperationsList/index.js @@ -119,7 +119,7 @@ export class OperationsList extends PureComponent { { const { t, error } = this.props if (!error) return null if (typeof error === 'string') return error - return t(`errors:${error.name}`, error) + const translation = t(`errors:${error.name}`, error) + if (translation) { + return translation + } + logger.warn('TranslatedError: no transation!', error.name, error) + return error.message || error.name || t('errors:generic') } } diff --git a/static/i18n/en/errors.yml b/static/i18n/en/errors.yml index 456fc91a..8f853eb0 100644 --- a/static/i18n/en/errors.yml +++ b/static/i18n/en/errors.yml @@ -1,7 +1,8 @@ -RangeError: {{message}} -Error: {{message}} -LedgerAPIErrorWithMessage: {{message}} -TransportStatusError: {{message}} +generic: An error occurred +RangeError: '{{message}}' +Error: '{{message}}' +LedgerAPIErrorWithMessage: '{{message}}' +TransportStatusError: '{{message}}' FeeEstimationFailed: 'fee estimation failed (status: {{status}})' NotEnoughBalance: 'Not enough balance' BtcUnmatchedApp: 'You must open application ‘{{currencyName}}’ on the device' diff --git a/static/i18n/fr/errors.yml b/static/i18n/fr/errors.yml index c8209f96..bc373e92 100644 --- a/static/i18n/fr/errors.yml +++ b/static/i18n/fr/errors.yml @@ -1,12 +1,9 @@ --- -RangeError: - - message -Error: - - message -LedgerAPIErrorWithMessage: - - message -TransportStatusError: - - message +generic: An error occurred +RangeError: '{{message}}' +Error: '{{message}}' +LedgerAPIErrorWithMessage: '{{message}}' +TransportStatusError: '{{message}}' FeeEstimationFailed: 'fee estimation failed (status: {{status}})' NotEnoughBalance: 'Not enough balance' BtcUnmatchedApp: 'You must open application ‘{{currencyName}}’ on the device'