From 80fd07bcfe83a219ad22213feb333e3f41322253 Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Wed, 22 Jan 2025 16:41:22 +0300 Subject: [PATCH] fix extra movement to the right Signed-off-by: Uncle Stretch --- src/components/validator/mod.rs | 5 ++++- src/components/wallet/mod.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/validator/mod.rs b/src/components/validator/mod.rs index 96b1c48..3cc84e9 100644 --- a/src/components/validator/mod.rs +++ b/src/components/validator/mod.rs @@ -160,7 +160,10 @@ impl Component for Validator { fn update(&mut self, action: Action) -> Result> { match action { - Action::SetActiveScreen(Mode::Validator) => self.is_active = true, + Action::SetActiveScreen(Mode::Validator) => { + self.is_active = true; + self.current_tab = CurrentTab::StashInfo; + }, _ => {}, } for component in self.components.iter_mut() { diff --git a/src/components/wallet/mod.rs b/src/components/wallet/mod.rs index 3f4d934..c989e3f 100644 --- a/src/components/wallet/mod.rs +++ b/src/components/wallet/mod.rs @@ -191,7 +191,10 @@ impl Component for Wallet { fn update(&mut self, action: Action) -> Result> { match action { - Action::SetActiveScreen(Mode::Wallet) => self.is_active = true, + Action::SetActiveScreen(Mode::Wallet) => { + self.is_active = true; + self.current_tab = CurrentTab::Accounts; + }, Action::UpdateAccountName(_) | Action::NewAccount(_) => self.current_tab = CurrentTab::Accounts, Action::UpdateAddressBookRecord(_) | Action::NewAddressBookRecord(_, _) | Action::ClosePopup =>