From 0f86f678f8d0934bdc9aac544af172d9f44b3bdd Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 17 Sep 2021 14:20:16 -0230 Subject: [PATCH] Add notification about need for ledger firmware update (#12144) * Add notification about need for ledger firmware update * Update messaging for ledger firmware notice * Code cleanup --- app/_locales/en/messages.json | 12 ++++++++++++ shared/notifications/index.js | 15 +++++++++++++++ ui/selectors/selectors.js | 6 +++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 388649813..9a56fc39b 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1558,6 +1558,18 @@ "message": "Ledger Support Update for Chrome Users", "description": "Title for a notification in the 'See What's New' popup. Lets users know about the Ledger support update" }, + "notifications7DescriptionOne": { + "message": "MetaMask v10.1.0 included new support for EIP-1559 transactions when using Ledger devices.", + "description": "Description of a notification in the 'See What's New' popup. Describes changes for ledger and EIP1559 in v10.1.0" + }, + "notifications7DescriptionTwo": { + "message": "To complete transactions on Ethereum Mainnet, make sure your Ledger device has the latest firmware.", + "description": "Description of a notification in the 'See What's New' popup. Describes the need to update ledger firmware." + }, + "notifications7Title": { + "message": "Ledger firmware update", + "description": "Title for a notification in the 'See What's New' popup. Notifies ledger users of the need to update firmware." + }, "ofTextNofM": { "message": "of" }, diff --git a/shared/notifications/index.js b/shared/notifications/index.js index 96f1f4fec..4649fce00 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -30,6 +30,10 @@ export const UI_NOTIFICATIONS = { id: 6, date: '2021-05-26', }, + 7: { + id: 7, + date: '2021-09-17', + }, }; export const getTranslatedUINoficiations = (t, locale) => { @@ -82,5 +86,16 @@ export const getTranslatedUINoficiations = (t, locale) => { new Date(UI_NOTIFICATIONS[6].date), ), }, + 7: { + ...UI_NOTIFICATIONS[7], + title: t('notifications7Title'), + description: [ + t('notifications7DescriptionOne'), + t('notifications7DescriptionTwo'), + ], + date: new Intl.DateTimeFormat(formattedLocale).format( + new Date(UI_NOTIFICATIONS[7].date), + ), + }, }; }; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index b35125ba9..124e39bc4 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -546,13 +546,17 @@ export function getShowWhatsNewPopup(state) { * @returns {Object} */ function getAllowedNotificationIds(state) { + const currentKeyring = getCurrentKeyring(state); + const currentKeyringIsLedger = currentKeyring?.type === KEYRING_TYPES.LEDGER; + return { 1: true, 2: true, 3: true, 4: getCurrentChainId(state) === BSC_CHAIN_ID, 5: true, - 6: true, + 6: currentKeyringIsLedger, + 7: currentKeyringIsLedger, }; }