1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

Add whats new popup for changes to advanced gas fee (#20632)

* Add whats new popup for changes to advanced gas fee

* Update shared/notifications/index.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* updated text

* verified working, changed order of init

* use first renderer for formatting issue

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
This commit is contained in:
Brad Decker 2023-08-29 16:15:35 -05:00 committed by GitHub
parent 0c9a61aabe
commit 863362dc37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 3 deletions

View File

@ -2792,6 +2792,15 @@
"notifications23Title": {
"message": "Stay safe with security alerts"
},
"notifications24ActionText": {
"message": "Got it"
},
"notifications24Description": {
"message": "Advanced gas fee settings are now remembered based on the network you're using. This means you can set specific advanced gas fees for each network and avoid overpaying for gas or stuck transactions."
},
"notifications24Title": {
"message": "Advanced gas fees by network"
},
"notifications3ActionText": {
"message": "Read more",
"description": "The 'call to action' on the button, or link, of the 'Stay secure' notification. Upon clicking, users will be taken to a page about security on the metamask support website."

View File

@ -49,13 +49,13 @@ export default class AppStateController extends EventEmitter {
showProductTour: true,
trezorModel: null,
currentPopupId: undefined,
...initState,
qrHardware: {},
nftsDropdownState: {},
// This key is only used for checking if the user had set advancedGasFee
// prior to Migration 92.3 where we split out the setting to support
// multiple networks.
hadAdvancedGasFeesSetPriorToMigration92_3: false,
...initState,
qrHardware: {},
nftsDropdownState: {},
usedNetworks: {
'0x1': true,
'0x5': true,

View File

@ -131,6 +131,10 @@ export const UI_NOTIFICATIONS = {
},
},
///: END:ONLY_INCLUDE_IN
24: {
id: 24,
date: null,
},
};
export const getTranslatedUINotifications = (t, locale) => {
@ -358,5 +362,16 @@ export const getTranslatedUINotifications = (t, locale) => {
: '',
},
///: END:ONLY_INCLUDE_IN
24: {
...UI_NOTIFICATIONS[24],
title: t('notifications24Title'),
description: t('notifications24Description'),
actionText: t('notifications24ActionText'),
date: UI_NOTIFICATIONS[24].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[24].date),
)
: '',
},
};
};

View File

@ -109,6 +109,9 @@ function getActionFunctionById(id, history) {
history.push(`${EXPERIMENTAL_ROUTE}#transaction-security-check`);
},
///: END:ONLY_INCLUDE_IN
24: () => {
updateViewedNotifications({ 24: true });
},
};
return actionFunctions[id];
@ -391,6 +394,7 @@ export default function WhatsNewPopup({
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
23: renderFirstNotification,
///: END:ONLY_INCLUDE_IN
24: renderFirstNotification,
};
return (

View File

@ -1042,6 +1042,7 @@ function getAllowedAnnouncementIds(state) {
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
23: true,
///: END:ONLY_INCLUDE_IN
24: state.metamask.hadAdvancedGasFeesSetPriorToMigration92_3 === true,
};
}