diff --git a/gui/src/hw.rs b/gui/src/hw.rs index 8592dcda..f67757e2 100644 --- a/gui/src/hw.rs +++ b/gui/src/hw.rs @@ -239,11 +239,27 @@ impl HardwareWallets { bitbox2 = bitbox2.with_policy(&desc)?; registered = bitbox2.is_policy_registered(&desc).await?; - } - if wallet - .map(|w| w.descriptor_keys().contains(&fingerprint)) - == Some(true) - { + if wallet.descriptor_keys().contains(&fingerprint) { + Ok(HardwareWallet::Supported { + id: id.clone(), + kind: DeviceKind::BitBox02, + fingerprint, + device: bitbox2.into(), + version: None, + registered: Some(registered), + alias: None, + }) + } else { + Ok(HardwareWallet::Unsupported { + id: id.clone(), + kind: DeviceKind::BitBox02, + version: None, + reason: UnsupportedReason::NotPartOfWallet( + fingerprint, + ), + }) + } + } else { Ok(HardwareWallet::Supported { id: id.clone(), kind: DeviceKind::BitBox02, @@ -253,15 +269,6 @@ impl HardwareWallets { registered: Some(registered), alias: None, }) - } else { - Ok(HardwareWallet::Unsupported { - id: id.clone(), - kind: DeviceKind::BitBox02, - version: None, - reason: UnsupportedReason::NotPartOfWallet( - fingerprint, - ), - }) } }, |res| HardwareWalletMessage::Unlocked(id_cloned, res),