mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Fix a few Snap state issues (#14339)
* Fix clearSnapState * Simplify getSnapState
This commit is contained in:
parent
6e73c34e2b
commit
e77ff0bce8
@ -1034,10 +1034,10 @@ export default class MetamaskController extends EventEmitter {
|
||||
'SnapController:add',
|
||||
),
|
||||
clearSnapState: (fromSubject) =>
|
||||
this.controllerMessenger(
|
||||
'SnapController:updateSnap',
|
||||
this.controllerMessenger.call(
|
||||
'SnapController:updateSnapState',
|
||||
fromSubject,
|
||||
{},
|
||||
null,
|
||||
),
|
||||
getMnemonic: this.getPrimaryKeyringMnemonic.bind(this),
|
||||
getSnap: this.controllerMessenger.call.bind(
|
||||
@ -1048,16 +1048,10 @@ export default class MetamaskController extends EventEmitter {
|
||||
this.controllerMessenger,
|
||||
'SnapController:getRpcMessageHandler',
|
||||
),
|
||||
getSnapState: async (...args) => {
|
||||
// TODO:flask Just return the action result directly in the next
|
||||
// @metamask/snap-controllers update.
|
||||
return (
|
||||
(await this.controllerMessenger.call(
|
||||
'SnapController:getSnapState',
|
||||
...args,
|
||||
)) ?? null
|
||||
);
|
||||
},
|
||||
getSnapState: this.controllerMessenger.call.bind(
|
||||
this.controllerMessenger,
|
||||
'SnapController:getSnapState',
|
||||
),
|
||||
showConfirmation: (origin, confirmationData) =>
|
||||
this.approvalController.addAndShowApprovalRequest({
|
||||
origin,
|
||||
|
Loading…
Reference in New Issue
Block a user