summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-04 15:31:12 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-06 00:18:55 +0300
commitff2c030c0fd71b3ef9405df62e2131df0417c465 (patch)
treefc09fc3a8dea70cc8c142a3d98f15f3642972ab0
parentb920834117c971eca805efa7202cd638d37dd97f (diff)
ui: process refresh events immediately
-rw-r--r--ui/src/components/mail/view.rs13
-rw-r--r--ui/src/state.rs2
2 files changed, 10 insertions, 5 deletions
diff --git a/ui/src/components/mail/view.rs b/ui/src/components/mail/view.rs
index ab67aca1..39cf9086 100644
--- a/ui/src/components/mail/view.rs
+++ b/ui/src/components/mail/view.rs
@@ -660,12 +660,14 @@ impl Component for MailView {
}
self.mode = ViewMode::ContactSelector(Selector::new(entries, true));
self.dirty = true;
+ return true;
}
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
self.cmd_buf.clear();
context
.replies
.push_back(UIEvent::StatusEvent(StatusEvent::BufClear));
+ return true;
}
UIEvent::Input(Key::Char(c)) if c >= '0' && c <= '9' => {
self.cmd_buf.push(c);
@@ -674,12 +676,14 @@ impl Component for MailView {
.push_back(UIEvent::StatusEvent(StatusEvent::BufSet(
self.cmd_buf.clone(),
)));
+ return true;
}
UIEvent::Input(Key::Alt('r'))
if self.mode == ViewMode::Normal || self.mode == ViewMode::Subview =>
{
self.mode = ViewMode::Raw;
self.set_dirty();
+ return true;
}
UIEvent::Input(Key::Char('r'))
if self.mode.is_attachment()
@@ -689,6 +693,7 @@ impl Component for MailView {
{
self.mode = ViewMode::Normal;
self.set_dirty();
+ return true;
}
UIEvent::Input(Key::Char('a'))
if !self.cmd_buf.is_empty()
@@ -818,6 +823,7 @@ impl Component for MailView {
.stdout(Stdio::piped())
.spawn()
.expect("Failed to start xdg_open");
+ return true;
}
UIEvent::Input(Key::Char('u')) => {
match self.mode {
@@ -826,6 +832,7 @@ impl Component for MailView {
_ => {}
}
self.dirty = true;
+ return true;
}
UIEvent::EnvelopeRename(old_hash, new_hash) if self.coordinates.2 == old_hash => {
self.coordinates.2 = new_hash;
@@ -919,11 +926,9 @@ impl Component for MailView {
}
}
}
- _ => {
- return false;
- }
+ _ => {}
}
- true
+ false
}
fn is_dirty(&self) -> bool {
self.dirty
diff --git a/ui/src/state.rs b/ui/src/state.rs
index 36efc1fe..a2c7602c 100644
--- a/ui/src/state.rs
+++ b/ui/src/state.rs
@@ -276,7 +276,7 @@ impl State {
return;
}
if let Some(notification) = self.context.accounts[idxa].reload(event, hash) {
- self.context.replies.push_back(notification);
+ self.rcv_event(notification);
} else {
self.context
.replies