Skip to content

Commit

Permalink
Actually handle DNS failures, fix white background
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed Dec 30, 2023
1 parent 8134f51 commit 7b80dae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ 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::<std::io::Error>() {
match err.raw_os_error() {
// Retry on DNS lookup failure.
#[cfg(windows)]
Some(windows_sys::Win32::Networking::WinSock::WSAHOST_NOT_FOUND) => {
return true
}
_ => {}
_ => break,
}
} else {
source = err.source();
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 7b80dae

Please sign in to comment.