1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +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 GitHub
parent ad919026ab
commit 36c0dfb1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -801,6 +801,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

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