diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs index 82bf0786..6c9706b5 100644 --- a/ui/src/components/mail/listing/compact.rs +++ b/ui/src/components/mail/listing/compact.rs @@ -77,10 +77,16 @@ impl ListingTrait for CompactListing { fn coordinates(&self) -> (usize, usize, Option) { (self.new_cursor_pos.0, self.new_cursor_pos.1, None) } + fn set_coordinates(&mut self, coordinates: (usize, usize, Option)) { self.new_cursor_pos = (coordinates.0, coordinates.1, 0); self.unfocused = false; + self.filtered_selection.clear(); + self.filtered_order.clear(); + self.filter_term.clear(); + self.row_updates.clear(); } + fn highlight_line(&mut self, grid: &mut CellBuffer, area: Area, idx: usize, context: &Context) { if self.length == 0 { return; diff --git a/ui/src/components/mail/listing/conversations.rs b/ui/src/components/mail/listing/conversations.rs index 4010907a..d628cce6 100644 --- a/ui/src/components/mail/listing/conversations.rs +++ b/ui/src/components/mail/listing/conversations.rs @@ -111,6 +111,10 @@ impl ListingTrait for ConversationsListing { fn set_coordinates(&mut self, coordinates: (usize, usize, Option)) { self.new_cursor_pos = (coordinates.0, coordinates.1, 0); self.unfocused = false; + self.filtered_selection.clear(); + self.filtered_order.clear(); + self.filter_term.clear(); + self.row_updates.clear(); } fn highlight_line(&mut self, grid: &mut CellBuffer, area: Area, idx: usize, context: &Context) { diff --git a/ui/src/components/mail/listing/plain.rs b/ui/src/components/mail/listing/plain.rs index be31814e..e419bde9 100644 --- a/ui/src/components/mail/listing/plain.rs +++ b/ui/src/components/mail/listing/plain.rs @@ -92,6 +92,8 @@ impl ListingTrait for PlainListing { } fn set_coordinates(&mut self, coordinates: (usize, usize, Option)) { self.new_cursor_pos = (coordinates.0, coordinates.1, 0); + self.unfocused = false; + self.local_collection.clear(); } fn highlight_line(&mut self, grid: &mut CellBuffer, area: Area, idx: usize, context: &Context) { let account = &context.accounts[self.cursor_pos.0]; diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs index d29bccb0..9a8dfc65 100644 --- a/ui/src/components/mail/listing/thread.rs +++ b/ui/src/components/mail/listing/thread.rs @@ -58,6 +58,9 @@ impl ListingTrait for ThreadListing { } fn set_coordinates(&mut self, coordinates: (usize, usize, Option)) { self.new_cursor_pos = (coordinates.0, coordinates.1, 0); + self.unfocused = false; + self.locations.clear(); + self.initialised = false; } fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0