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:
Observer KRypt0n_ 2023-02-28 22:52:18 +02:00
parent 8935e566d9
commit a3aad7a2f4
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -626,6 +626,7 @@ impl SimpleAsyncComponent for GeneralApp {
let package = VoicePackage::with_locale(package.locale).unwrap();
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());
@ -640,6 +641,11 @@ impl SimpleAsyncComponent for GeneralApp {
sender.output(PreferencesAppMsg::UpdateLauncherState);
});
}
else {
sender.input(GeneralAppMsg::SetVoicePackageSensitivity(index, true));
}
}
}
}