From 7d866b28fd2286e34ab4f8b212c03f02fec4226e Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Mon, 11 Jul 2022 13:07:02 +0200 Subject: [PATCH] Do not offer "Protect" button for recovery keys (#734) 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) --- src/frontend/src/flows/manage/deviceSettings.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/flows/manage/deviceSettings.ts b/src/frontend/src/flows/manage/deviceSettings.ts index 63ea5c749c..c3650a4629 100644 --- a/src/frontend/src/flows/manage/deviceSettings.ts +++ b/src/frontend/src/flows/manage/deviceSettings.ts @@ -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;