Skip to content

Commit

Permalink
chore(components, suite): make onChange param required on Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
komret committed Feb 4, 2025
1 parent b9e3796 commit 1b0bcbe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/form/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const Label = styled.label<{
export interface SwitchProps {
isChecked: boolean;
label?: ReactNode;
onChange: (isChecked?: boolean) => void;
onChange: (isChecked: boolean) => void;
isDisabled?: boolean;
isAlert?: boolean;
isSmall?: boolean; // TODO: legacy prop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ export const CheckFirmwareAuthenticity = () => {
const isFirmwareHashCheckEnabled = useSelector(selectIsFirmwareHashCheckEnabled);
const isFirmwareRevisionCheckEnabled = useSelector(selectIsFirmwareRevisionCheckEnabled);

const toggleEntropyCheck = (isChecked?: boolean) =>
const toggleEntropyCheck = (isChecked: boolean) =>
dispatch({
type: SUITE.TOGGLE_ENTROPY_CHECK,
payload: !!isChecked,
payload: isChecked,
});
const toggleFirmwareHashCheck = (isChecked?: boolean) =>
const toggleFirmwareHashCheck = (isChecked: boolean) =>
dispatch({
type: SUITE.TOGGLE_FIRMWARE_HASH_CHECK,
payload: !!isChecked,
payload: isChecked,
});
const toggleFirmwareRevisionCheck = (isChecked?: boolean) =>
const toggleFirmwareRevisionCheck = (isChecked: boolean) =>
dispatch({
type: SUITE.TOGGLE_FIRMWARE_REVISION_CHECK,
payload: !!isChecked,
payload: isChecked,
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const DeviceAuthenticity = () => {
const dispatch = useDispatch();
const debug = useSelector(state => state.suite.settings.debug);

const handleChange = (state?: boolean) =>
const handleChange = (state: boolean) =>
dispatch(setDebugMode({ isUnlockedBootloaderAllowed: state }));

return (
Expand Down

0 comments on commit 1b0bcbe

Please sign in to comment.