mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove confirmation for terminated snaps (#14566)
This commit is contained in:
parent
12cda5eb2d
commit
b258cbafe7
@ -1226,6 +1226,26 @@ export default class MetamaskController extends EventEmitter {
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
this.controllerMessenger.subscribe(
|
||||
`${this.snapController.name}:snapTerminated`,
|
||||
(snapId) => {
|
||||
const approvals = Object.values(
|
||||
this.approvalController.state.pendingApprovals,
|
||||
).filter(
|
||||
(approval) =>
|
||||
approval.origin === snapId &&
|
||||
approval.type === MESSAGE_TYPE.SNAP_CONFIRM,
|
||||
);
|
||||
for (const approval of approvals) {
|
||||
this.approvalController.reject(
|
||||
approval.id,
|
||||
new Error('Snap was terminated.'),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user