diff --git a/Cargo.lock b/Cargo.lock index c64db32..c0d3483 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,8 +40,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.5.1" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.1#4af7a14fc7e86d40cd97a7beb448a6d593a7d43d" +version = "1.5.2" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.2#002bed907fc47c53d18764fb87aec2398413f1a0" dependencies = [ "anyhow", "bzip2", @@ -86,8 +86,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "0.5.12" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.12#06f0f486b9e099fc96db71be339332e1961dd0f6" +version = "0.5.13" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.13#66a80e5f5906b1cfc1b9716a4448dd03cf854ae8" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 6a3bca9..b042872 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ glib-build-tools = "0.17" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "0.5.12" +tag = "0.5.13" # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/src/ui/first_run/main.rs b/src/ui/first_run/main.rs index 03863b4..f93099d 100644 --- a/src/ui/first_run/main.rs +++ b/src/ui/first_run/main.rs @@ -232,8 +232,7 @@ impl SimpleComponent for FirstRunApp { Ok(None) => { for host in &CONFIG.components.servers { match components.sync(host) { - Ok(true) => break, - Ok(false) => continue, + Ok(_) => break, Err(err) => { tracing::error!("Failed to sync components index"); diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 060b899..830dcc1 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -694,19 +694,24 @@ impl SimpleComponent for App { Ok(None) => { for host in &CONFIG.components.servers { match components.sync(host) { - Ok(true) => { - // TODO: add changelog log here - + Ok(changes) => { sender.input(AppMsg::Toast { title: tr("components-index-updated"), - description: None + description: if changes.is_empty() { + None + } else { + let max_len = changes.iter().map(|line| line.len()).max().unwrap_or(80); + + Some(changes.into_iter() + .map(|line| format!("- {line}{}", " ".repeat(max_len - line.len()))) + .collect::>() + .join("\n")) + } }); break; } - Ok(false) => continue, - Err(err) => { tracing::error!("Failed to sync components index"); @@ -742,16 +747,7 @@ impl SimpleComponent for App { Ok(None) => { for server in &CONFIG.patch.servers { match patch.sync(server) { - Ok(true) => break, - - Ok(false) => { - tracing::error!("Failed to sync patch folder with remote: {server}"); - - sender.input(AppMsg::Toast { - title: tr("patch-sync-failed"), - description: None - }); - } + Ok(_) => break, Err(err) => { tracing::error!("Failed to sync patch folder with remote: {server}: {err}");