diff --git a/src/fs.rs b/src/fs.rs index 1d5522a..099b0b4 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -7,6 +7,7 @@ use crate::config::APP_DIRECTORY_NAME; pub async fn get_cache_path() -> crate::Result { static CACHE: tokio::sync::OnceCell = tokio::sync::OnceCell::const_new(); + Ok(CACHE .get_or_try_init(async || -> crate::Result { let mut path = tokio::task::spawn_blocking(dirs::cache_dir) diff --git a/src/main.rs b/src/main.rs index 730ea96..61d1368 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,7 @@ mod scraper; #[cfg(feature = "tui")] mod tui; mod utils; + use std::sync::Arc; use color_eyre::eyre::WrapErr as _; diff --git a/src/tui.rs b/src/tui.rs index faf7f5d..8f05bcc 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -47,6 +47,7 @@ pub async fn run( let mut app_state = AppState::default(); let logger_state = TuiWidgetState::default(); + while !matches!(app_state.mode, AppMode::Quit) { if let Some(event) = rx.recv().await { if handle_event(event, &mut app_state, &token, &logger_state) {