Skip to content

Commit

Permalink
Merge branch 'attestation-nil'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Oct 26, 2022
2 parents d45103a + 2cdd792 commit 0f9a4f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontends/web/src/api/bitbox02.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ export const setMnemonicPassphraseEnabled = (

export const verifyAttestation = (
deviceID: string,
): Promise<boolean> => {
): Promise<boolean | null> => {
return apiGet(`devices/bitbox02/${deviceID}/attestation`);
};
5 changes: 2 additions & 3 deletions frontends/web/src/routes/device/bitbox02/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ type Props = {
export const Settings: FunctionComponent<Props> = ({ deviceID }) => {
const { t } = useTranslation();
const [deviceInfo, setDeviceInfo] = useState<DeviceInfo>();
const [attestation, setAttestation] = useState<boolean>();

const [attestation, setAttestation] = useState<boolean | null>(null);
useEffect(() => {
getDeviceInfo(deviceID).then(setDeviceInfo).catch(error => {
console.error(error);
Expand Down Expand Up @@ -89,7 +88,7 @@ export const Settings: FunctionComponent<Props> = ({ deviceID }) => {
{t('deviceSettings.hardware.securechip')}
</SettingsItem>
) }
{attestation !== undefined && (
{attestation !== null && (
<SettingsItem
optionalText={t(`deviceSettings.hardware.attestation.${attestation}`)}
optionalIcon={attestation ? <Checked/> : <Warning/>}>
Expand Down

0 comments on commit 0f9a4f0

Please sign in to comment.