From 882224f26c514fd94f8c43317df908bf4400f274 Mon Sep 17 00:00:00 2001 From: elpatron Date: Fri, 6 Mar 2026 20:09:27 +0100 Subject: [PATCH] Fix: update status after download completes Made-with: Cursor --- HotKeet/src/ui.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/HotKeet/src/ui.rs b/HotKeet/src/ui.rs index e59f37a..8088545 100644 --- a/HotKeet/src/ui.rs +++ b/HotKeet/src/ui.rs @@ -243,6 +243,15 @@ impl SettingsApp { let model_path = Path::new(&self.config.model_path); let model_valid = !self.config.model_path.is_empty() && model::is_model_valid(model_path); let downloading = self.download_progress.as_ref().and_then(|p| p.read().ok()).and_then(|g| g.clone()); + + // Download complete: update status even when model_valid is now true + if matches!(downloading, Some(model::DownloadProgress::Finished)) { + self.status = "Model downloaded. Remember to save.".to_string(); + if let Some(ref p) = self.download_progress { + let _ = p.write().map(|mut w| *w = None); + } + } + if !self.config.model_path.is_empty() && !model_valid { ui.horizontal(|ui| { ui.colored_label(egui::Color32::YELLOW, "Model not found in folder."); @@ -265,10 +274,6 @@ impl SettingsApp { } model::DownloadProgress::Finished => { ui.colored_label(egui::Color32::GREEN, "Download complete."); - self.status = "Model downloaded. Remember to save.".to_string(); - if let Some(ref p) = self.download_progress { - let _ = p.write().map(|mut w| *w = None); - } } model::DownloadProgress::Error(e) => { ui.colored_label(egui::Color32::RED, format!("Error: {}", e));