feat(ui): added changelog to updated components toast

Implemented SDK 0.5.13
This commit is contained in:
Observer KRypt0n_ 2023-04-08 21:57:52 +02:00
parent 22598efb15
commit 49ebbc35a2
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
4 changed files with 18 additions and 23 deletions

8
Cargo.lock generated
View file

@ -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",

View file

@ -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

View file

@ -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");

View file

@ -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::<Vec<_>>()
.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}");