1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix a few Snap state issues (#14339)

* Fix clearSnapState

* Simplify getSnapState
This commit is contained in:
Frederik Bolding 2022-04-04 16:32:49 +02:00 committed by GitHub
parent 6e73c34e2b
commit e77ff0bce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1034,10 +1034,10 @@ export default class MetamaskController extends EventEmitter {
'SnapController:add', 'SnapController:add',
), ),
clearSnapState: (fromSubject) => clearSnapState: (fromSubject) =>
this.controllerMessenger( this.controllerMessenger.call(
'SnapController:updateSnap', 'SnapController:updateSnapState',
fromSubject, fromSubject,
{}, null,
), ),
getMnemonic: this.getPrimaryKeyringMnemonic.bind(this), getMnemonic: this.getPrimaryKeyringMnemonic.bind(this),
getSnap: this.controllerMessenger.call.bind( getSnap: this.controllerMessenger.call.bind(
@ -1048,16 +1048,10 @@ export default class MetamaskController extends EventEmitter {
this.controllerMessenger, this.controllerMessenger,
'SnapController:getRpcMessageHandler', 'SnapController:getRpcMessageHandler',
), ),
getSnapState: async (...args) => { getSnapState: this.controllerMessenger.call.bind(
// TODO:flask Just return the action result directly in the next this.controllerMessenger,
// @metamask/snap-controllers update. 'SnapController:getSnapState',
return ( ),
(await this.controllerMessenger.call(
'SnapController:getSnapState',
...args,
)) ?? null
);
},
showConfirmation: (origin, confirmationData) => showConfirmation: (origin, confirmationData) =>
this.approvalController.addAndShowApprovalRequest({ this.approvalController.addAndShowApprovalRequest({
origin, origin,