fix: fixed merging issues

This commit is contained in:
Nikita Podvirnyi 2024-08-02 11:56:19 +02:00
parent 898388e1b9
commit 008b8ce1b5
No known key found for this signature in database
GPG key ID: 859D416E5142AFF3
6 changed files with 61 additions and 49 deletions

4
Cargo.lock generated
View file

@ -82,8 +82,8 @@ dependencies = [
[[package]] [[package]]
name = "anime-launcher-sdk" name = "anime-launcher-sdk"
version = "1.17.0" version = "1.17.1"
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.17.0#a17a0824344d24bf02de00aee71967b028c176bb" source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.17.1#017d0d164f7d8b16043d42a8be7187c21951faf0"
dependencies = [ dependencies = [
"anime-game-core", "anime-game-core",
"anyhow", "anyhow",

View file

@ -19,7 +19,7 @@ glib-build-tools = "0.20"
[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 = "1.17.0" tag = "1.17.1"
features = ["all", "star-rail", "star-rail-patch"] features = ["all", "star-rail", "star-rail-patch"]
# path = "../anime-launcher-sdk" # ! for dev purposes only # path = "../anime-launcher-sdk" # ! for dev purposes only

View file

@ -353,7 +353,7 @@ impl SimpleAsyncComponent for DefaultPathsApp {
DefaultPathsAppMsg::Continue => { DefaultPathsAppMsg::Continue => {
match self.update_config() { match self.update_config() {
Ok(_) => { Ok(_) => {
sender.output(Self::Output::ScrollToSelectVoiceovers); sender.output(Self::Output::ScrollToDownloadComponents);
} }
Err(err) => { Err(err) => {

View file

@ -990,7 +990,11 @@ impl SimpleComponent for App {
// Update initial patch status // Update initial patch status
tasks.push(std::thread::spawn(clone!(@strong sender => move || { tasks.push(std::thread::spawn(clone!(
#[strong]
sender,
move || {
// Get main patch status // Get main patch status
sender.input(AppMsg::SetMainPatch(match jadeite::get_metadata() { sender.input(AppMsg::SetMainPatch(match jadeite::get_metadata() {
Ok(metadata) => { Ok(metadata) => {
@ -1014,7 +1018,8 @@ impl SimpleComponent for App {
})); }));
tracing::info!("Updated patch status"); tracing::info!("Updated patch status");
}))); }
)));
// Update initial game version status // Update initial game version status
@ -1089,13 +1094,13 @@ impl SimpleComponent for App {
"locale" = locale.to_name() "locale" = locale.to_name()
}))))); })))));
} }
}
StateUpdating::Patch => { StateUpdating::Patch => {
sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--patch"))))); sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--patch")))));
} }
} }
} }
}
); );
let state = match LauncherState::get_from_config(updater) { let state = match LauncherState::get_from_config(updater) {

View file

@ -17,7 +17,11 @@ pub fn update_patch(sender: ComponentSender<App>, progress_bar_input: Sender<Pro
std::thread::spawn(move || { std::thread::spawn(move || {
let result = jadeite::get_latest() let result = jadeite::get_latest()
.and_then(|patch| patch.install(config.patch.path, clone!(@strong sender => move |state| { .and_then(|patch| patch.install(config.patch.path, clone!(
#[strong]
sender,
move |state| {
match &state { match &state {
InstallerUpdate::DownloadingError(err) => { InstallerUpdate::DownloadingError(err) => {
tracing::error!("Downloading failed: {err}"); tracing::error!("Downloading failed: {err}");
@ -43,7 +47,8 @@ pub fn update_patch(sender: ComponentSender<App>, progress_bar_input: Sender<Pro
#[allow(unused_must_use)] { #[allow(unused_must_use)] {
progress_bar_input.send(ProgressBarMsg::UpdateFromState(state.into())); progress_bar_input.send(ProgressBarMsg::UpdateFromState(state.into()));
} }
}))); }
)));
if let Err(err) = result { if let Err(err) = result {
tracing::error!("Failed to download latest patch version"); tracing::error!("Failed to download latest patch version");

View file

@ -22,6 +22,8 @@ pub mod components;
use components::*; use components::*;
use crate::ui::preferences::main::PreferencesAppMsg;
use crate::i18n::*; use crate::i18n::*;
use crate::*; use crate::*;