Skip to content

Commit 0886920

Browse files
committed
added error screen, if no mods are in the save
1 parent 597d7b3 commit 0886920

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/vendor/factorioSave/factorioSave.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ var constraintGreaterThan0_16 *semver.Constraints
5454

5555
func ReadHeader(filePath string) (Header, error) {
5656
var err error
57+
data = Header{}
5758

5859
constraintGreaterThan0_16, _ = semver.NewConstraint(">= 0.16.0")
5960

@@ -201,7 +202,6 @@ func ReadHeader(filePath string) (Header, error) {
201202
data.Mods = append(data.Mods, SingleMod)
202203
}
203204

204-
log.Println(data)
205205
return data, nil
206206
}
207207

ui/App/components/Mods/ModLoadSave.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ class ModLoadSave extends React.Component {
4444
checkboxes.push(singleCheckbox);
4545
});
4646

47+
if(checkboxes.length == 0) {
48+
swal({
49+
title: "No mods in this save!",
50+
type: "error"
51+
});
52+
return;
53+
}
54+
4755
let table = <div>
4856
All Mods will be installed
4957
<div style={{display: "flex", width: "100%", justifyContent: "center"}}>

0 commit comments

Comments
 (0)