diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2018-08-15 13:42:45 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:29 +0300 |
commit | 832d1243de50c24354665da4e2c0aed53cdf8679 (patch) | |
tree | 05438d471a29578cb0c134ef8647518cebf539bd /ui | |
parent | 415ce2a27ef9f290eb1a2be5b0c7833900f6c911 (diff) |
Show correct thread on unthreaded view
Closes #31
Diffstat (limited to 'ui')
-rw-r--r-- | ui/src/components/mail/view/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/src/components/mail/view/mod.rs b/ui/src/components/mail/view/mod.rs index 724e0657..75783c31 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<usize>, pager: Option<Pager>, subview: Option<Box<Component>>, dirty: bool, @@ -70,11 +71,13 @@ impl fmt::Display for MailView { impl MailView { pub fn new( coordinates: (usize, usize, usize), + local_collection: Vec<usize>, pager: Option<Pager>, subview: Option<Box<Component>>, ) -> 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]; |