From c2a8cf809267cb6f4dc11b9b16d8b03d7ef786e2 Mon Sep 17 00:00:00 2001 From: edouardparis Date: Mon, 9 Sep 2024 18:02:45 +0200 Subject: [PATCH] Reset hws watch list at each installer step Because of flaky connection, we drop the connection list to reconstruct it at each step of the installer close #1307 --- gui/src/hw.rs | 4 ++++ gui/src/installer/mod.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gui/src/hw.rs b/gui/src/hw.rs index 0b3d32b6..74bd3a25 100644 --- a/gui/src/hw.rs +++ b/gui/src/hw.rs @@ -198,6 +198,10 @@ impl HardwareWallets { self.aliases.insert(fg, new_alias); } + pub fn reset_watch_list(&mut self) { + self.list = Vec::new(); + } + pub fn load_aliases(&mut self, aliases: HashMap) { self.aliases = aliases; } diff --git a/gui/src/installer/mod.rs b/gui/src/installer/mod.rs index 6464bae7..43be9df3 100644 --- a/gui/src/installer/mod.rs +++ b/gui/src/installer/mod.rs @@ -66,6 +66,7 @@ pub struct Installer { impl Installer { fn previous(&mut self) -> Command { + self.hws.reset_watch_list(); let network = self.network; if self.current > 0 { self.current -= 1; @@ -196,6 +197,7 @@ impl Installer { } fn next(&mut self) -> Command { + self.hws.reset_watch_list(); let current_step = self .steps .get_mut(self.current)