gui: do not display hw error on simple user refusal

close #937
This commit is contained in:
edouardparis 2024-02-02 11:32:39 +01:00
parent 445a8c1334
commit 3a30a36ce5
3 changed files with 15 additions and 3 deletions

View File

@ -477,7 +477,11 @@ impl Action for SignAction {
Message::Signed(fingerprint, res) => {
self.signing.remove(&fingerprint);
match res {
Err(e) => self.error = Some(e),
Err(e) => {
if !matches!(e, Error::HardwareWallet(async_hwi::Error::UserRefused)) {
self.error = Some(e)
}
}
Ok(psbt) => {
self.error = None;
self.signed.insert(fingerprint);

View File

@ -264,7 +264,11 @@ impl RegisterWalletModal {
self.registered.insert(fingerprint);
return Command::perform(async {}, |_| Message::LoadWallet);
}
Err(e) => self.warning = Some(e),
Err(e) => {
if !matches!(e, Error::HardwareWallet(async_hwi::Error::UserRefused)) {
self.warning = Some(e)
}
}
}
Command::none()
}

View File

@ -1437,7 +1437,11 @@ impl Step for RegisterDescriptor {
self.hmacs.push((fingerprint, *hw_h.kind(), hmac));
}
}
Err(e) => self.error = Some(e),
Err(e) => {
if !matches!(e, Error::HardwareWallet(async_hwi::Error::UserRefused)) {
self.error = Some(e)
}
}
}
}
Message::Reload => {