Skip to content

Commit

Permalink
updates after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Jun 18, 2024
1 parent a381f25 commit c7cb50a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/snaps-controllers/coverage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"branches": 91.78,
"functions": 96.77,
"lines": 97.9,
"statements": 97.57
"branches": 91.59,
"functions": 96.45,
"lines": 97.66,
"statements": 97.34
}
10 changes: 5 additions & 5 deletions packages/snaps-simulator/src/contexts/SnapInterface.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UserInputEventType } from '@metamask/snaps-sdk';
import type { FormState, InterfaceState } from '@metamask/snaps-sdk';
import type { FormState, State } from '@metamask/snaps-sdk';
import { HandlerType } from '@metamask/snaps-utils';
import debounce from 'lodash.debounce';
import throttle from 'lodash.throttle';
Expand All @@ -23,7 +23,7 @@ const noOp = () => {
/* No Op */
};

export type GetValue = (name: string, form?: string) => string | undefined;
export type GetValue = (name: string, form?: string) => State | undefined;

export type HandleInputChange = (
name: string,
Expand All @@ -34,7 +34,7 @@ export type HandleInputChange = (
export type HandleEvent = (args: {
event: UserInputEventType;
name?: string;
value?: string;
value?: State;
}) => void;

export type SnapInterfaceContextType = {
Expand Down Expand Up @@ -99,7 +99,7 @@ export const SnapInterfaceContextProvider: FunctionComponent<
const rawSnapRequestFunction = (
event: UserInputEventType,
name?: string,
value?: string | InterfaceState,
value?: State | FormState,
) => {
dispatch(
sendRequest({
Expand Down Expand Up @@ -143,7 +143,7 @@ export const SnapInterfaceContextProvider: FunctionComponent<
const handleEvent: HandleEvent = ({
event,
name,
value = name ? state[name] ?? undefined : undefined,
value = name ? (state as FormState)[name] ?? undefined : undefined,
}) => {
const fn = THROTTLED_EVENTS.includes(event)
? snapRequestThrottled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Input: FunctionComponent<InputProps> = ({ node, id, form }) => {
return (
<ChakraInput
key={`${id}-input`}
value={value}
value={value as string}
type={props.type}
placeholder={props.placeholder}
onChange={handleChange}
Expand Down

0 comments on commit c7cb50a

Please sign in to comment.