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,11 +109,15 @@ impl Main {
} }
fn exchange_recv(&mut self) { fn exchange_recv(&mut self) {
loop {
match self.c.try_recv() { match self.c.try_recv() {
Ok(msg) => self.ntfy2 = msg, Ok(msg) => {
_ => {}, self.ntfy2 = msg
},
_ => return,
}; };
} }
}
fn exchange_send(&mut self) { fn exchange_send(&mut self) {
let mut s = vec![]; let mut s = vec![];
@ -343,7 +347,9 @@ impl Feedback {
loop { loop {
std::thread::sleep(std::time::Duration::from_secs(2)); std::thread::sleep(std::time::Duration::from_secs(2));
match self.read() { match self.read() {
Some(msg) if msg.len() > 0 => self.write(msg), Some(msg) if msg.len() > 0 => {
self.write(msg.clone());
},
_ => {}, _ => {},
}; };
} }