diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index c372515..d83ce39 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -746,37 +746,7 @@ fn main() { app_data.join("vyla-home-files") }; - let version_file = vyla_files.join("version.json"); - let current_app_version = app.package_info().version.to_string(); - let mut version_mismatch = false; - - if version_file.exists() { - if let Ok(content) = std::fs::read_to_string(&version_file) { - if let Ok(json) = serde_json::from_str::(&content) { - if let Some(version) = json.get("version").and_then(|v| v.as_str()) { - if version != current_app_version { - version_mismatch = true; - } - } else { - version_mismatch = true; - } - } else { - version_mismatch = true; - } - } - } - - if version_mismatch { - debug_log(&format!( - "App version updated to {}. Cleaning old files.", - current_app_version - )); - let dirs_to_remove = ["frontend", "player", "stream-api", "auth-proxy", "config"]; - for d in dirs_to_remove { - let _ = std::fs::remove_dir_all(vyla_files.join(d)); - } - let _ = std::fs::remove_file(&version_file); - } + let _ = std::fs::create_dir_all(&vyla_files); let window = WebviewWindowBuilder::new(app, "main", WebviewUrl::App("index.html".into())) .title("Vyla Home") diff --git a/ui/index.html b/ui/index.html index 8471d23..ee75d16 100644 --- a/ui/index.html +++ b/ui/index.html @@ -569,15 +569,14 @@ void main() { if (progressTrack) progressTrack.style.display = "block"; const percent = data.percent || 0; if (progressFill) progressFill.style.width = percent + "%"; - if (!currentStatusText.startsWith("Downloading update...")) { - setStatus("Downloading update..."); - } + setStatus(`Downloading update (${percent}%)...`); } }); eventApi.listen("update-available", (e) => { const data = e.payload || e; if (data) { + if (progressTrack) progressTrack.style.display = "none"; setStatus(`Update Available: ${data.latest} (Current: ${data.current})`); if (actionsEl) actionsEl.style.display = "flex"; } @@ -586,6 +585,8 @@ void main() { eventApi.listen("ready", (e) => { const data = e.payload || e; if (data && data.url) { + if (progressTrack) progressTrack.style.display = "none"; + if (actionsEl) actionsEl.style.display = "none"; setStatus("Launching..."); } });