Skip to content

Commit

Permalink
silence typescript error
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Jun 13, 2024
1 parent c936278 commit e889624
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/snaps-simulator/src/features/simulation/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
SnapRpcHookArgs,
VirtualFile,
} from '@metamask/snaps-utils';
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
import {
createAction,
createSelector,
Expand Down Expand Up @@ -118,9 +118,8 @@ const slice = createSlice({
state.icon = action.payload;
},
setSnapInterface: (state, action: PayloadAction<SnapInterface>) => {
// `immer` does not work well with generic types, so we have to cast.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
state.snapInterface = action.payload as Draft<SnapInterface>;
// @ts-expect-error `immer` does not work well with generic types.
state.snapInterface = action.payload;
},
setSnapInterfaceState: (state, action: PayloadAction<InterfaceState>) => {
if (state.snapInterface) {
Expand Down

0 comments on commit e889624

Please sign in to comment.