diff --git a/ui/src/components/mail/view/mod.rs b/ui/src/components/mail/view/mod.rs index 724e0657c..75783c314 100644 --- a/ui/src/components/mail/view/mod.rs +++ b/ui/src/components/mail/view/mod.rs @@ -52,6 +52,7 @@ impl ViewMode { /// menus pub struct MailView { coordinates: (usize, usize, usize), + local_collection: Vec, pager: Option, subview: Option>, dirty: bool, @@ -70,11 +71,13 @@ impl fmt::Display for MailView { impl MailView { pub fn new( coordinates: (usize, usize, usize), + local_collection: Vec, pager: Option, subview: Option>, ) -> Self { MailView { coordinates, + local_collection, pager, subview, dirty: true, @@ -218,7 +221,7 @@ impl Component for MailView { let envelope_idx: usize = if threaded { mailbox.threaded_mail(self.coordinates.2) } else { - self.coordinates.2 + self.local_collection[self.coordinates.2] }; let envelope: &Envelope = &mailbox.collection[envelope_idx]; @@ -381,7 +384,7 @@ impl Component for MailView { let envelope_idx: usize = if threaded { mailbox.threaded_mail(self.coordinates.2) } else { - self.coordinates.2 + self.local_collection[self.coordinates.2] }; let envelope: &Envelope = &mailbox.collection[envelope_idx]; @@ -453,7 +456,7 @@ impl Component for MailView { let envelope_idx: usize = if threaded { mailbox.threaded_mail(self.coordinates.2) } else { - self.coordinates.2 + self.local_collection[self.coordinates.2] }; let envelope: &Envelope = &mailbox.collection[envelope_idx];