Make sure checksum matches in ModsTable

Validate sha1 sum matches for a mod used in ModsTable if it is present.
This prevents showing details for a zip file where the version matches
but the cheksum does not.
This commit is contained in:
Hornwitser committed 2022-11-10 00:28:50 +01:00
1 parent dfadc62720
commit 32cf9321cc
1 file changed
+7 -1
@@ -211,7 +211,13 @@ function ModsTable(props) {
const modListMap = new Map(modList.map(mod => [`${mod.name}_${mod.version}`, mod]));
const mods = [...props.modPack.mods.values(), ...deletedMods.values()].map(
mod => modListMap.get(`${mod.name}_${mod.version}`) || mod
mod => {
const candidate = modListMap.get(`${mod.name}_${mod.version}`);
if (!candidate || mod.sha1 && candidate.sha1 !== mod.sha1) {
return mod;
}
return candidate;
}
);
function actions(mod) {