diff --git a/rm-main/src/app.rs b/rm-main/src/app.rs index cfee80d..b805707 100644 --- a/rm-main/src/app.rs +++ b/rm-main/src/app.rs @@ -180,15 +180,14 @@ impl App { match action { UpdateAction::SwitchToInputMode => { self.mode = Mode::Input; - self.ctx.send_action(Action::Render); } UpdateAction::SwitchToNormalMode => { self.mode = Mode::Normal; - self.ctx.send_action(Action::Render); } _ => self.main_window.handle_update_action(action), - } + }; + self.ctx.send_action(Action::Render); } fn tick(&mut self) { diff --git a/rm-main/src/ui/mod.rs b/rm-main/src/ui/mod.rs index fc5dca2..a118134 100644 --- a/rm-main/src/ui/mod.rs +++ b/rm-main/src/ui/mod.rs @@ -71,7 +71,6 @@ impl Component for MainWindow { UpdateAction::Error(err) => { let error_popup = ErrorPopup::new(err.title, err.description, err.source); self.global_popup_manager.error_popup = Some(error_popup); - self.ctx.send_action(Action::Render); } action if self.tabs.current_tab == CurrentTab::Torrents => { self.torrents_tab.handle_update_action(action) diff --git a/rm-main/src/ui/tabs/search.rs b/rm-main/src/ui/tabs/search.rs index 703ca6c..3525d1a 100644 --- a/rm-main/src/ui/tabs/search.rs +++ b/rm-main/src/ui/tabs/search.rs @@ -183,7 +183,6 @@ impl Component for SearchTab { match action { UpdateAction::SearchStarted => { self.search_result_info.searching(ThrobberState::default()); - self.ctx.send_action(Action::Render); } UpdateAction::SearchResults(magnets) => { if magnets.is_empty() { @@ -192,7 +191,6 @@ impl Component for SearchTab { self.search_result_info.found(magnets.len()); } self.table.set_items(magnets); - self.ctx.send_action(Action::Render); } _ => (), } @@ -200,7 +198,6 @@ impl Component for SearchTab { fn tick(&mut self) { self.search_result_info.tick(); - self.ctx.send_action(Action::Render); } fn render(&mut self, f: &mut Frame, rect: Rect) { diff --git a/rm-main/src/ui/tabs/torrents/mod.rs b/rm-main/src/ui/tabs/torrents/mod.rs index debc1f4..0c8bd1b 100644 --- a/rm-main/src/ui/tabs/torrents/mod.rs +++ b/rm-main/src/ui/tabs/torrents/mod.rs @@ -119,21 +119,17 @@ impl Component for TorrentsTab { match action { UpdateAction::SessionStats(stats) => { self.bottom_stats.set_stats(stats); - self.ctx.send_action(Action::Render); } UpdateAction::FreeSpace(free_space) => { self.bottom_stats.set_free_space(free_space); - self.ctx.send_action(Action::Render); } UpdateAction::SearchFilterApply(filter) => { self.table_manager.filter.replace(filter); self.table_manager.table.state.borrow_mut().select(Some(0)); - self.ctx.send_action(Action::Render); } UpdateAction::SearchFilterClear => { self.table_manager.filter = None; self.table_manager.table.state.borrow_mut().select(Some(0)); - self.ctx.send_action(Action::Render); } UpdateAction::UpdateTorrents(torrents) => { self.table_manager.set_new_rows(torrents); diff --git a/rm-main/src/ui/tabs/torrents/popups/files.rs b/rm-main/src/ui/tabs/torrents/popups/files.rs index a82dd6a..0eb3646 100644 --- a/rm-main/src/ui/tabs/torrents/popups/files.rs +++ b/rm-main/src/ui/tabs/torrents/popups/files.rs @@ -178,7 +178,6 @@ impl Component for FilesPopup { let new_tree = Node::new_from_torrent(&torrent); self.torrent = Some(torrent); self.tree = new_tree; - self.ctx.send_action(Action::Render); } }