Skip to content

Commit

Permalink
Add preferences-controller getState action handler, stateChange subsc…
Browse files Browse the repository at this point in the history
…ription
  • Loading branch information
MajorLift committed Mar 9, 2024
1 parent 1960afe commit d71a6d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,15 @@ export default class MetamaskController extends EventEmitter {
listener,
),
});
this.controllerMessenger.registerActionHandler(
`PreferencesController:getState`,
() => this.preferencesController.store.getState(),
);
this.controllerMessenger.registerInitialEventPayload({
eventType: `PreferencesController:stateChange`,
getPayload: () => [this.preferencesController.store.getState(), []],
});
this.controllerMessenger.subscribe(`PreferencesController:stateChange`);

this.assetsContractController = new AssetsContractController(
{
Expand Down

0 comments on commit d71a6d2

Please sign in to comment.