added error screen, if no mods are in the save

This commit is contained in:
knoxfighter 2018-07-18 03:39:36 +02:00
parent 597d7b3b23
commit 0886920356
2 changed files with 9 additions and 1 deletions

View File

@ -54,6 +54,7 @@ var constraintGreaterThan0_16 *semver.Constraints
func ReadHeader(filePath string) (Header, error) {
var err error
data = Header{}
constraintGreaterThan0_16, _ = semver.NewConstraint(">= 0.16.0")
@ -201,7 +202,6 @@ func ReadHeader(filePath string) (Header, error) {
data.Mods = append(data.Mods, SingleMod)
}
log.Println(data)
return data, nil
}

View File

@ -44,6 +44,14 @@ class ModLoadSave extends React.Component {
checkboxes.push(singleCheckbox);
});
if(checkboxes.length == 0) {
swal({
title: "No mods in this save!",
type: "error"
});
return;
}
let table = <div>
All Mods will be installed
<div style={{display: "flex", width: "100%", justifyContent: "center"}}>