Skip to content

Commit

Permalink
fixup! feat(suite-native): add Check Settings to toggle FW revision c…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
Lemonexe committed Jan 29, 2025
1 parent 2278e8f commit c9a3c5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useDispatch, useSelector } from 'react-redux';

import {
selectIsFirmwareAuthenticityCheckDisabled,
setCheckFirmwareAuthenticityDisabled,
selectIsFirmwareAuthenticityCheckEnabled,
setCheckFirmwareAuthenticity,
SettingsCardWithIconLayout,
} from '@suite-native/settings';
import { Translation } from '@suite-native/intl';
Expand Down Expand Up @@ -39,7 +39,7 @@ const TurnOnButton = () => {
const dispatch = useDispatch();
const { showToast } = useToast();
const handleButtonPress = () => {
dispatch(setCheckFirmwareAuthenticityDisabled(false));
dispatch(setCheckFirmwareAuthenticity(true));
showToast({
variant: 'default',
message: 'Authenticity check turned on',
Expand Down Expand Up @@ -74,7 +74,7 @@ const TurnOffButton = () => {
};

export const TurnOffFirmwareAuthenticityCheckCard = () => {
const isFwAuthenticityCheckDisabled = useSelector(selectIsFirmwareAuthenticityCheckDisabled);
const isFwAuthenticityCheckEnabled = useSelector(selectIsFirmwareAuthenticityCheckEnabled);

return (
<SettingsCardWithIconLayout
Expand All @@ -86,15 +86,15 @@ export const TurnOffFirmwareAuthenticityCheckCard = () => {
<Translation id="moduleSettings.deviceChecks.firmwareAuthenticityCheck.subtitle" />
</Text>
<HStack spacing="sp8">
{isFwAuthenticityCheckDisabled ? (
{isFwAuthenticityCheckEnabled ? (
<>
<TurnOffButton />
<LearnMoreButton />
<TurnOnButton />
</>
) : (
<>
<TurnOffButton />
<LearnMoreButton />
<TurnOnButton />
</>
)}
</HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
VStack,
} from '@suite-native/atoms';
import { Translation } from '@suite-native/intl';
import { setCheckFirmwareAuthenticityDisabled } from '@suite-native/settings';
import { setCheckFirmwareAuthenticity } from '@suite-native/settings';
import { useToast } from '@suite-native/toasts';

const CHECKBOX_ANIMATION_DURATION = 200; // same as in useAccordionAnimation
Expand Down Expand Up @@ -67,7 +67,7 @@ export const TurnOffFirmwareAuthenticityCheckModalScreen = () => {
const handleCheckboxPress = () => setIsChecked(prev => !prev);

const handleButtonPress = () => {
dispatch(setCheckFirmwareAuthenticityDisabled(true));
dispatch(setCheckFirmwareAuthenticity(false));
if (navigation.canGoBack()) {
navigation.goBack();
} else {
Expand Down

0 comments on commit c9a3c5f

Please sign in to comment.