From cf086b606509a29a015f158d3db1747d587fd74f Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 19 Aug 2022 23:38:04 +0200 Subject: [PATCH] Add note about UI events --- src/euph/room.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/euph/room.rs b/src/euph/room.rs index 8556f41..3cb44e6 100644 --- a/src/euph/room.rs +++ b/src/euph/room.rs @@ -152,6 +152,13 @@ impl State { event_rx: &mut mpsc::UnboundedReceiver, ) -> anyhow::Result<()> { while let Some(event) = event_rx.recv().await { + // TODO Send UI events on more occasions + // Example: When a room disconnects at the moment, the screen is + // redrawn. Why? Because tungstenite debug-logs that the connection + // was closed and the log then causes a full-screen redraw. This is + // a clear case of "works but only because mistakes cancel out". A + // first step towards fixing this would be to only redraw if an + // event affected the currently visible screen. match event { Event::Connected(conn_tx) => self.conn_tx = Some(conn_tx), Event::Disconnected => {