summaryrefslogtreecommitdiffstats
path: root/src/components/mail/listing.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-25 20:41:26 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-26 16:09:41 +0300
commit26b327d86ac94d3affbf192250098dc47cc08b0a (patch)
tree62c135679f401f93e3201886bffc5a2a53ee3ace /src/components/mail/listing.rs
parentb5530860d24bf148f9b788b6f4743604d76db24f (diff)
mail/listing*: clear selection after perform_action()
Diffstat (limited to 'src/components/mail/listing.rs')
-rw-r--r--src/components/mail/listing.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs
index 799b11d4..eaf55fcc 100644
--- a/src/components/mail/listing.rs
+++ b/src/components/mail/listing.rs
@@ -341,6 +341,7 @@ pub trait MailListingTrait: ListingTrait {
}
fn row_updates(&mut self) -> &mut SmallVec<[ThreadHash; 8]>;
+ fn selection(&mut self) -> &mut HashMap<ThreadHash, bool>;
fn get_focused_items(&self, _context: &Context) -> SmallVec<[ThreadHash; 8]>;
fn redraw_threads_list(
&mut self,
@@ -743,6 +744,14 @@ impl Component for Listing {
| Action::Listing(a @ ListingAction::Tag(_)) => {
let focused = self.component.get_focused_items(context);
self.component.perform_action(context, focused, a);
+ let mut row_updates: SmallVec<[ThreadHash; 8]> = SmallVec::new();
+ for (k, v) in self.component.selection().iter_mut() {
+ if *v {
+ *v = false;
+ row_updates.push(*k);
+ }
+ }
+ self.component.row_updates().extend(row_updates.drain(..));
self.component.set_dirty(true);
return true;
}