mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Merge pull request #291 from Zagrios/bugfix/sometimes-installing-mods-downgrades-newer-installed-mods
[bugfix] do not install mods that are less recent than those installed
This commit is contained in:
@@ -82,11 +82,15 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion;
|
||||
}
|
||||
const modsToInstall = modsSelected.filter(mod => {
|
||||
const corespondingMod = modsAvailable.get(mod.category).find(availabeMod => availabeMod._id === mod._id);
|
||||
if (lt(corespondingMod.version, mod.version)) {
|
||||
const installedMod = modsInstalled.get(mod.category)?.find(installedMod => installedMod.name === mod.name);
|
||||
|
||||
if (lt(corespondingMod.version, mod.version) || lt(mod.version, installedMod?.version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
modsManager.installMods(modsToInstall, version).then(() => {
|
||||
loadMods();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user