Add note about UI events

This commit is contained in:
Joscha 2022-08-19 23:38:04 +02:00
parent 037bed698c
commit cf086b6065

View file

@ -152,6 +152,13 @@ impl State {
event_rx: &mut mpsc::UnboundedReceiver<Event>, event_rx: &mut mpsc::UnboundedReceiver<Event>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
while let Some(event) = event_rx.recv().await { 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 { match event {
Event::Connected(conn_tx) => self.conn_tx = Some(conn_tx), Event::Connected(conn_tx) => self.conn_tx = Some(conn_tx),
Event::Disconnected => { Event::Disconnected => {