Skip to content

Commit

Permalink
esc/quit to deselect
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski committed Sep 5, 2024
1 parent 527a542 commit 78c5d70
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rm-main/src/tui/tabs/torrents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,22 @@ impl Component for TorrentsTab {
return ComponentAction::Nothing;
}

if !self.table_manager.selected_torrents_ids.is_empty() {
if action.is_soft_quit() {
self.table_manager
.table
.items
.iter_mut()
.for_each(|t| t.is_selected = false);
self.table_manager.selected_torrents_ids.drain(..);
self.ctx.send_action(Action::Render);
return ComponentAction::Nothing;
}
}

if action.is_quit() {
self.ctx.send_action(Action::HardQuit);
return ComponentAction::Nothing;
}

match action {
Expand Down

0 comments on commit 78c5d70

Please sign in to comment.