gui flushes all messages received from server at once, both dedupes and doesnt fill q
parent
49133b5f7a
commit
645285019e
16
src/gui.rs
16
src/gui.rs
|
|
@ -109,10 +109,14 @@ impl Main {
|
|||
}
|
||||
|
||||
fn exchange_recv(&mut self) {
|
||||
match self.c.try_recv() {
|
||||
Ok(msg) => self.ntfy2 = msg,
|
||||
_ => {},
|
||||
};
|
||||
loop {
|
||||
match self.c.try_recv() {
|
||||
Ok(msg) => {
|
||||
self.ntfy2 = msg
|
||||
},
|
||||
_ => return,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn exchange_send(&mut self) {
|
||||
|
|
@ -343,7 +347,9 @@ impl Feedback {
|
|||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(2));
|
||||
match self.read() {
|
||||
Some(msg) if msg.len() > 0 => self.write(msg),
|
||||
Some(msg) if msg.len() > 0 => {
|
||||
self.write(msg.clone());
|
||||
},
|
||||
_ => {},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue