[hotfix] fixed handling for filtering out mods to uninstall

This commit is contained in:
silentrald
2025-01-29 09:27:51 +08:00
parent eff5d5728f
commit d209d6c336
@@ -531,9 +531,11 @@ export class BsModsManagerService {
const versionMods = await this.getAvailableMods(version);
const installedMods = await this.getInstalledMods(version);
const fullInstalledMods: BbmFullMod[] = installedMods?.map(version => {
return { version, mod: versionMods.find(mod => version.modId === mod.mod.id)?.mod };
}) ?? [];
const fullInstalledMods = (installedMods || []).reduce((mods, version) => {
const mod = versionMods.find(mod => version.modId === mod.mod.id)?.mod;
if (mod) { mods.push({ version, mod }); }
return mods;
}, [] as BbmFullMod[]);
const progress = { current: 0, total: fullInstalledMods.length };