1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

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
This commit is contained in:
Dan J Miller 2021-09-17 14:20:16 -02:30 committed by GitHub
parent ade9e4ac4b
commit 0f86f678f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

View File

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

View File

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

View File

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