Open
Description
We may want to consider allowing nested code fences, so we can avoid code looking like this due to more feature flags being added over time:
///: BEGIN:ONLY_INCLUDE_IN(snaps)
export function removeSnap(
snapId: string,
): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> {
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());
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(keyring-snaps)
const subjects = getPermissionSubjects(getState()) as {
[k: string]: { permissions: Record<string, any> };
};
const isAccountsSnap =
subjects[snapId]?.permissions?.snap_manageAccounts !== undefined;
///: END:ONLY_INCLUDE_IN
(...)