fix non-tui uis

This commit is contained in:
monosans
2025-04-11 15:18:46 +03:00
parent 4df9f85101
commit d098ac074e
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
use crate::event::Event;
use crate::event::{AppEvent, Event};
pub(crate) struct DummyUI {}
@@ -14,7 +14,11 @@ impl super::UI for DummyUI {
_tx: tokio::sync::mpsc::UnboundedSender<Event>,
mut rx: tokio::sync::mpsc::UnboundedReceiver<Event>,
) -> color_eyre::Result<()> {
while rx.recv().await.is_some() {}
while let Some(event) = rx.recv().await {
if let Event::App(AppEvent::Done) = event {
break;
}
}
Ok(())
}
}
+6 -2
View File
@@ -1,4 +1,4 @@
use crate::event::Event;
use crate::event::{AppEvent, Event};
pub(crate) struct LoggerUI {}
@@ -17,7 +17,11 @@ impl super::UI for LoggerUI {
_tx: tokio::sync::mpsc::UnboundedSender<Event>,
mut rx: tokio::sync::mpsc::UnboundedReceiver<Event>,
) -> color_eyre::Result<()> {
while rx.recv().await.is_some() {}
while let Some(event) = rx.recv().await {
if let Event::App(AppEvent::Done) = event {
break;
}
}
Ok(())
}
}