From 16cb4cbb99d5ba4028151e67e104624a3464ea90 Mon Sep 17 00:00:00 2001 From: Remigiusz Micielski Date: Thu, 20 Jun 2024 17:14:48 +0200 Subject: [PATCH] fix: unstyled paused torrents after search --- rm-main/src/ui/tabs/torrents/rustmission_torrent.rs | 2 +- rm-main/src/ui/tabs/torrents/tasks/filter.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rm-main/src/ui/tabs/torrents/rustmission_torrent.rs b/rm-main/src/ui/tabs/torrents/rustmission_torrent.rs index 966f400..19c8cf3 100644 --- a/rm-main/src/ui/tabs/torrents/rustmission_torrent.rs +++ b/rm-main/src/ui/tabs/torrents/rustmission_torrent.rs @@ -44,7 +44,7 @@ impl RustmissionTorrent { if highlighted_indices.contains(&index) { torrent_name_line.push_span(Span::styled(char.to_string(), highlight_style)); } else { - torrent_name_line.push_span(Span::raw(char.to_string())) + torrent_name_line.push_span(Span::styled(char.to_string(), self.style)) } } diff --git a/rm-main/src/ui/tabs/torrents/tasks/filter.rs b/rm-main/src/ui/tabs/torrents/tasks/filter.rs index e5b815f..f58cecc 100644 --- a/rm-main/src/ui/tabs/torrents/tasks/filter.rs +++ b/rm-main/src/ui/tabs/torrents/tasks/filter.rs @@ -37,10 +37,10 @@ impl Component for FilterBar { fn handle_actions(&mut self, action: Action) -> Option { match action { Action::Input(input) => { - if input.code == KeyCode::Enter { - return Some(Action::Quit); - } - if input.code == KeyCode::Esc { + if matches!(input.code, KeyCode::Enter | KeyCode::Esc) { + if self.input.text().is_empty() { + *self.table_manager.lock().unwrap().filter.lock().unwrap() = None; + } return Some(Action::Quit); }