mail/listing.rs: prevent list blank when refreshing account

Mail list would go blank if the currently focused account received a
Status update event.
pull/211/head
Manos Pitsidianakis 2023-05-16 19:48:48 +03:00
parent 428f752b20
commit 91557c2c43
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
3 changed files with 8 additions and 6 deletions

View File

@ -147,15 +147,15 @@ impl MailboxConf {
}
}
pub fn true_val() -> bool {
pub const fn true_val() -> bool {
true
}
pub fn false_val() -> bool {
pub const fn false_val() -> bool {
false
}
pub fn none<T>() -> Option<T> {
pub const fn none<T>() -> Option<T> {
None
}

View File

@ -19,8 +19,8 @@
* along with meli. If not, see <http://www.gnu.org/licenses/>.
*/
/*! Entities that handle Mail specific functions.
*/
//! Entities that handle Mail specific functions.
use melib::{
backends::{AccountHash, Mailbox, MailboxHash},
email::{attachment_types::*, attachments::*},

View File

@ -1037,7 +1037,6 @@ impl Component for Listing {
},
})
.collect::<_>();
self.set_dirty(true);
self.menu_content.empty();
context
.replies
@ -1945,6 +1944,7 @@ impl Component for Listing {
}
false
}
fn is_dirty(&self) -> bool {
self.dirty
|| self
@ -1953,6 +1953,7 @@ impl Component for Listing {
.map(Component::is_dirty)
.unwrap_or_else(|| self.component.is_dirty())
}
fn set_dirty(&mut self, value: bool) {
self.dirty = value;
if let Some(s) = self.status.as_mut() {
@ -2577,6 +2578,7 @@ impl Listing {
.process_event(&mut UIEvent::VisibilityChange(false), context);
self.component
.set_coordinates((account_hash, *mailbox_hash));
self.component.refresh_mailbox(context, true);
/* Check if per-mailbox configuration overrides general configuration */
let index_style =