From f7eed2a26a852c1eeffb539d8bf76a3981a0ce60 Mon Sep 17 00:00:00 2001 From: Matteo Scurati Date: Thu, 19 Sep 2024 20:55:36 +0200 Subject: [PATCH] fix: :sparkles: move notifications activated event (#27290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR moves a simple event before an async function to ensure that the event is executed properly. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27290?quickstart=1) ## **Related issues** N/A ## **Manual testing steps** N/A ## **Screenshots/Recordings** N/A ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- .../turn-on-metamask-notifications.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/modals/turn-on-metamask-notifications/turn-on-metamask-notifications.tsx b/ui/components/app/modals/turn-on-metamask-notifications/turn-on-metamask-notifications.tsx index de3da35fa841..b340ee8c5e60 100644 --- a/ui/components/app/modals/turn-on-metamask-notifications/turn-on-metamask-notifications.tsx +++ b/ui/components/app/modals/turn-on-metamask-notifications/turn-on-metamask-notifications.tsx @@ -59,7 +59,6 @@ export default function TurnOnMetamaskNotifications() { const handleTurnOnNotifications = async () => { setIsLoading(true); - await createNotifications(); trackEvent({ category: MetaMetricsEventCategory.NotificationsActivationFlow, event: MetaMetricsEventName.NotificationsActivated, @@ -68,6 +67,7 @@ export default function TurnOnMetamaskNotifications() { action_type: 'activated', }, }); + await createNotifications(); }; const handleHideModal = () => {