From 7b80dae2e232759592e567a8e9bb5637c77fbe8f Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Sat, 30 Dec 2023 13:17:22 -0800 Subject: [PATCH] Actually handle DNS failures, fix white background --- src/http.rs | 7 +++++-- src/main.rs | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/http.rs b/src/http.rs index 11f11fb..695b802 100644 --- a/src/http.rs +++ b/src/http.rs @@ -27,7 +27,8 @@ impl Client { return true; } - if let Some(err) = err.source() { + let mut source = err.source(); + while let Some(err) = source { if let Some(err) = err.downcast_ref::() { match err.raw_os_error() { // Retry on DNS lookup failure. @@ -35,8 +36,10 @@ impl Client { Some(windows_sys::Win32::Networking::WinSock::WSAHOST_NOT_FOUND) => { return true } - _ => {} + _ => break, } + } else { + source = err.source(); } } diff --git a/src/main.rs b/src/main.rs index 4f406b3..b2ac466 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,7 +92,8 @@ impl eframe::App for Slideshow { _ => (), } - let response = egui::CentralPanel::default().show(ctx, |ui| + let frame = egui::Frame::default().fill(Color32::BLACK); + let response = egui::CentralPanel::default().frame(frame).show(ctx, |ui| ui.centered_and_justified(|ui| match &self.current_state { Ok(AppState::LoadingImage) => {