diff --git a/appa-cosmic/src/app.rs b/appa-cosmic/src/app.rs index d710a4a..90fb73c 100644 --- a/appa-cosmic/src/app.rs +++ b/appa-cosmic/src/app.rs @@ -363,9 +363,12 @@ impl AppModel { content = content.push(self.folder_details_view(details)); } } else { - content = content.push(widget::text::body( - "Appa is not running. Start `appa daemon serve`, then refresh.", - )); + let connection_status = if self.notice.is_some() { + "Appa could not be reached. The connection error is shown above." + } else { + "Connecting to Appa…" + }; + content = content.push(widget::text::body(connection_status)); } content.into() } diff --git a/src/daemon.rs b/src/daemon.rs index 60b325a..e358c82 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -38,7 +38,10 @@ pub async fn serve(folder_path: Option<&Path>) -> anyhow::Result<()> { loop { tokio::select! { _ = tokio::signal::ctrl_c() => break, - _ = interval.tick() => sync_runner.tick(&service).await?, + result = async { + interval.tick().await; + sync_runner.tick(&service).await + } => result?, accepted = listener.accept() => { let (mut stream, _) = accepted?; handle_connection(&service, &mut stream).await;