1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00

Check for blocked snaps on extension startup (#20336)

* allow `SnapController` to call `SnapsRegistry:update`

* call `SnapController:updateBlockedSnaps` on extension startup

* only check if at least one snap is installed
This commit is contained in:
Guillaume Roux 2023-08-02 15:16:43 +02:00 committed by Dan J Miller
parent 7447fe14a9
commit c8f2e8e82d
2 changed files with 8 additions and 0 deletions

View File

@ -821,6 +821,13 @@ export function setupController(
});
}
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
// Updates the snaps registry and check for newly blocked snaps to block if the user has at least one snap installed.
if (Object.keys(controller.snapController.state.snaps).length > 0) {
controller.snapController.updateBlockedSnaps();
}
///: END:ONLY_INCLUDE_IN
}
//

View File

@ -959,6 +959,7 @@ export default class MetamaskController extends EventEmitter {
'ExecutionService:handleRpcRequest',
'SnapsRegistry:get',
'SnapsRegistry:getMetadata',
'SnapsRegistry:update',
],
});