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:
parent
6e73c34e2b
commit
e77ff0bce8
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user