mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2024-11-25 14:20:08 +03:00
feat(ui): added changelog to updated components toast
Implemented SDK 0.5.13
This commit is contained in:
parent
22598efb15
commit
49ebbc35a2
4 changed files with 18 additions and 23 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -40,8 +40,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-game-core"
|
name = "anime-game-core"
|
||||||
version = "1.5.1"
|
version = "1.5.2"
|
||||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.1#4af7a14fc7e86d40cd97a7beb448a6d593a7d43d"
|
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.2#002bed907fc47c53d18764fb87aec2398413f1a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
|
@ -86,8 +86,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-launcher-sdk"
|
name = "anime-launcher-sdk"
|
||||||
version = "0.5.12"
|
version = "0.5.13"
|
||||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.12#06f0f486b9e099fc96db71be339332e1961dd0f6"
|
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.13#66a80e5f5906b1cfc1b9716a4448dd03cf854ae8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anime-game-core",
|
"anime-game-core",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -17,7 +17,7 @@ glib-build-tools = "0.17"
|
||||||
|
|
||||||
[dependencies.anime-launcher-sdk]
|
[dependencies.anime-launcher-sdk]
|
||||||
git = "https://github.com/an-anime-team/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
|
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||||
|
|
||||||
|
|
|
@ -232,8 +232,7 @@ impl SimpleComponent for FirstRunApp {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
for host in &CONFIG.components.servers {
|
for host in &CONFIG.components.servers {
|
||||||
match components.sync(host) {
|
match components.sync(host) {
|
||||||
Ok(true) => break,
|
Ok(_) => break,
|
||||||
Ok(false) => continue,
|
|
||||||
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
tracing::error!("Failed to sync components index");
|
tracing::error!("Failed to sync components index");
|
||||||
|
|
|
@ -694,19 +694,24 @@ impl SimpleComponent for App {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
for host in &CONFIG.components.servers {
|
for host in &CONFIG.components.servers {
|
||||||
match components.sync(host) {
|
match components.sync(host) {
|
||||||
Ok(true) => {
|
Ok(changes) => {
|
||||||
// TODO: add changelog log here
|
|
||||||
|
|
||||||
sender.input(AppMsg::Toast {
|
sender.input(AppMsg::Toast {
|
||||||
title: tr("components-index-updated"),
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(false) => continue,
|
|
||||||
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
tracing::error!("Failed to sync components index");
|
tracing::error!("Failed to sync components index");
|
||||||
|
|
||||||
|
@ -742,16 +747,7 @@ impl SimpleComponent for App {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
for server in &CONFIG.patch.servers {
|
for server in &CONFIG.patch.servers {
|
||||||
match patch.sync(server) {
|
match patch.sync(server) {
|
||||||
Ok(true) => break,
|
Ok(_) => break,
|
||||||
|
|
||||||
Ok(false) => {
|
|
||||||
tracing::error!("Failed to sync patch folder with remote: {server}");
|
|
||||||
|
|
||||||
sender.input(AppMsg::Toast {
|
|
||||||
title: tr("patch-sync-failed"),
|
|
||||||
description: None
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
tracing::error!("Failed to sync patch folder with remote: {server}: {err}");
|
tracing::error!("Failed to sync patch folder with remote: {server}: {err}");
|
||||||
|
|
Loading…
Reference in a new issue