-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
NotificationServicesController
to accommodate for Snaps Noti…
…fications (#4809) ## Explanation * What is the current state of things and why does it need to change? We currently have snap types living in the extension, which should exist in this repo instead. Also, the extension is using two controllers to handle notifications, the `NotificationController` solely exists for the purpose of snap notifications. With the revamping of the notifications system, it is best to house all notifications in one place. * What is the solution your changes offer and how does it work? Add snap logic to the `NotificationServicesController` * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? The `updateMetamaskNotificationsList` function will be the gateway for snaps to add notifications to the controller. ## Changelog ### `@metamask/notification-services-controller` - **ADDED**: `getNotificationsByType` to grab a list of notifications by type. - **ADDED**: `deleteNotificationById` to delete a notification in the controller's state (to be only used by notifications that live in this controller which currently is just snaps). - **CHANGED**: `fetchAndUpdateMetamaskNotifications` to grab snaps from state before repopulating with a new list of other notifications. - **CHANGED**: `markNotificaftionsAsRead` to account for snaps notifications. - **CHANGED**: `updateMetamaskNotificationsList` to assign a processed notification to state instead of the originally passed in notification as the `processSnapNotification` function adds on extra properties to the raw notification. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
- Loading branch information
Showing
14 changed files
with
507 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.