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
feature/default_network_editable
Dan J Miller 3 years ago committed by Alex
parent 3f5dcbf697
commit d2e9de106b
  1. 12
      app/_locales/en/messages.json
  2. 15
      shared/notifications/index.js
  3. 6
      ui/selectors/selectors.js

@ -1516,6 +1516,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"
},

@ -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),
),
},
};
};

@ -547,13 +547,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,
};
}

Loading…
Cancel
Save