1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Fix a recent code-fencing issue with keyring snaps (#19874)

This commit is contained in:
Frederik Bolding 2023-07-06 11:15:14 +02:00 committed by GitHub
parent 1247e03a33
commit 5d3690aa24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1126,11 +1126,21 @@ export function enableSnap(
await forceUpdateMetamaskState(dispatch); await forceUpdateMetamaskState(dispatch);
}; };
} }
///: END:ONLY_INCLUDE_IN
// TODO: Clean this up.
///: BEGIN:ONLY_INCLUDE_IN(snaps)
export function removeSnap( export function removeSnap(
snapId: string, snapId: string,
): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> { ): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> {
return async (dispatch: MetaMaskReduxDispatch, getState) => { return async (
dispatch: MetaMaskReduxDispatch,
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
getState,
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
) => {
dispatch(showLoadingIndication()); dispatch(showLoadingIndication());
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps) ///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
@ -1140,7 +1150,9 @@ export function removeSnap(
const isAccountsSnap = const isAccountsSnap =
subjects[snapId]?.permissions?.snap_manageAccounts !== undefined; subjects[snapId]?.permissions?.snap_manageAccounts !== undefined;
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
try { try {
///: END:ONLY_INCLUDE_IN ///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps) ///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)