diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 98cd8ff5..d799bb23 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -2,6 +2,7 @@ import logger from 'logger' import { BigNumber } from 'bignumber.js' +import { StatusCodes } from '@ledgerhq/hw-transport' import Btc from '@ledgerhq/hw-app-btc' import { Observable } from 'rxjs' import { isSegwitDerivationMode } from '@ledgerhq/live-common/lib/derivation' @@ -13,6 +14,7 @@ import { bigNumberToLibcoreAmount, getOrCreateWallet, } from 'helpers/libcore' +import { UpdateYourApp } from 'config/errors' import withLibcore from 'helpers/withLibcore' import { createCommand, Command } from 'helpers/ipc' @@ -227,7 +229,12 @@ export async function doSignAndBroadcast({ hasTimestamp, derivationMode, }), - ) + ).catch(e => { + if (e && e.statusCode === StatusCodes.INCORRECT_P1_P2) { + throw new UpdateYourApp(`UpdateYourApp ${currency.id}`, currency) + } + throw e + }) if (!signedTransaction || isCancelled() || !njsAccount) return onSigned() diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 61691b0c..ceed59c5 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -826,8 +826,8 @@ "description": "Please try again or contact Ledger Support" }, "UpdateYourApp": { - "title": "App update required. Uninstall and reinstall the {{managerAppName}} app in the Manager", - "description": null + "title": "App update required", + "description": "Uninstall and reinstall the {{managerAppName}} app in the Manager" }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error).",