Skip to content

Commit

Permalink
fix(suite): Disable Check device button when disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemonexe committed Aug 15, 2024
1 parent 2fa5ac5 commit 3396117
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
} from 'src/components/suite';
import { useDispatch } from 'src/hooks/suite';

export const AuthenticateDevice = () => {
interface AuthenticateDeviceProps {
isDeviceLocked: boolean;
}

export const AuthenticateDevice = ({ isDeviceLocked }: AuthenticateDeviceProps) => {
const dispatch = useDispatch();

const handleClick = () => dispatch(openModal({ type: 'authenticate-device' }));
Expand All @@ -23,7 +27,7 @@ export const AuthenticateDevice = () => {
buttonLink={HELP_CENTER_DEVICE_AUTHENTICATION}
/>
<ActionColumn>
<ActionButton variant="secondary" onClick={handleClick}>
<ActionButton variant="secondary" onClick={handleClick} isDisabled={isDeviceLocked}>
<Translation id="TR_CHECK_ORIGIN" />
</ActionButton>
</ActionColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ export const SettingsDevice = () => {
{pinProtection && <ChangePin isDeviceLocked={isDeviceLocked} />}
<Passphrase isDeviceLocked={isDeviceLocked} />
{safetyChecks && <SafetyChecks isDeviceLocked={isDeviceLocked} />}
{supportsDeviceAuthentication && <AuthenticateDevice />}
{supportsDeviceAuthentication && (
<AuthenticateDevice isDeviceLocked={isDeviceLocked} />
)}
</SettingsSection>

<SettingsSection title={<Translation id="TR_PERSONALIZATION" />} icon="PALETTE">
Expand Down

0 comments on commit 3396117

Please sign in to comment.