fix state: add new hws in list without dropping the old ones
It should be a solution for #238
This commit is contained in:
parent
d9336c11ea
commit
73eb1d38e3
@ -118,8 +118,13 @@ impl State for RecoveryPanel {
|
||||
}
|
||||
}
|
||||
},
|
||||
// We add the new hws without dropping the reference of the previous ones.
|
||||
Message::ConnectedHardwareWallets(hws) => {
|
||||
self.hws = hws;
|
||||
for h in hws {
|
||||
if !self.hws.iter().any(|hw| hw.fingerprint == h.fingerprint) {
|
||||
self.hws.push(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
Message::Psbt(res) => match res {
|
||||
Ok(psbt) => self.generated = Some(psbt),
|
||||
|
||||
@ -330,8 +330,13 @@ impl Action for SignAction {
|
||||
Ok(()) => self.updated = true,
|
||||
Err(e) => self.error = Some(e),
|
||||
},
|
||||
// We add the new hws without dropping the reference of the previous ones.
|
||||
Message::ConnectedHardwareWallets(hws) => {
|
||||
self.hws = hws;
|
||||
for h in hws {
|
||||
if !self.hws.iter().any(|hw| hw.fingerprint == h.fingerprint) {
|
||||
self.hws.push(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
Message::View(view::Message::Reload) => {
|
||||
return self.load(daemon);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user