gui flushes all messages received from server at once, both dedupes and doesnt fill q

master v0.1.4
bel 2023-03-25 11:27:02 -06:00
parent 49133b5f7a
commit 645285019e
1 changed files with 11 additions and 5 deletions

View File

@ -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());
},
_ => {},
};
}