Skip to content

Commit

Permalink
Do not offer "Protect" button for recovery keys (#734)
Browse files Browse the repository at this point in the history
This fixes a small bug, where recorey keys would also offer the protect button despite not being able to be protected.
(Only recovery phrases can be protected)
  • Loading branch information
frederikrothenberger authored Jul 11, 2022
1 parent 9830ecc commit 7d866b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontend/src/flows/manage/deviceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const pageContent = (
// We offer to protect unprotected recovery phrases only, although in the
// future we may offer to protect all devices
const shouldOfferToProtect = (device: DeviceData): boolean =>
hasOwnProperty(device.purpose, "recovery") && !isProtected(device);
hasOwnProperty(device.purpose, "recovery") &&
hasOwnProperty(device.key_type, "seed_phrase") &&
!isProtected(device);

const isProtected = (device: DeviceData): boolean =>
"protected" in device.protection;
Expand Down

0 comments on commit 7d866b2

Please sign in to comment.