mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-21 20:36:01 +03:00
fix: fixed (?) error on deleting non-installed voice package
I didn't test this but I think it should work lol
This commit is contained in:
parent
8935e566d9
commit
a3aad7a2f4
1 changed files with 17 additions and 11 deletions
|
@ -626,19 +626,25 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
|
||||
let package = VoicePackage::with_locale(package.locale).unwrap();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
if let Err(err) = package.delete_in(&config.game.path) {
|
||||
tracing::error!("Failed to delete voice package: {:?}", package.locale());
|
||||
|
||||
sender.input(GeneralAppMsg::Toast {
|
||||
title: tr("voice-package-deletion-error"),
|
||||
description: Some(err.to_string())
|
||||
});
|
||||
}
|
||||
if !package.is_installed_in(&config.game.path) {
|
||||
std::thread::spawn(move || {
|
||||
if let Err(err) = package.delete_in(&config.game.path) {
|
||||
tracing::error!("Failed to delete voice package: {:?}", package.locale());
|
||||
|
||||
sender.input(GeneralAppMsg::Toast {
|
||||
title: tr("voice-package-deletion-error"),
|
||||
description: Some(err.to_string())
|
||||
});
|
||||
}
|
||||
|
||||
sender.input(GeneralAppMsg::SetVoicePackageSensitivity(index, true));
|
||||
sender.output(PreferencesAppMsg::UpdateLauncherState);
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
sender.input(GeneralAppMsg::SetVoicePackageSensitivity(index, true));
|
||||
sender.output(PreferencesAppMsg::UpdateLauncherState);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue