Skip to content

Commit 50f2f6d

Browse files
committed
Prevent production of empty slope levels when importing build plans (#2903)
1 parent 3323c2b commit 50f2f6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shared/customizer/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function parseWeights(toml: Toml.JsonMap, sink: CustomizerProps) {
8080
if (typeof v.shape !== "number") continue;
8181
for (const [gr, _f] of Gr.AllWeightGrades) if (gr === v.shape) weights.add(gr);
8282
}
83-
sink = { ...sink, weightGradesIncluded: weights };
83+
if (weights.size != 0) sink = { ...sink, weightGradesIncluded: weights };
8484
return sink;
8585
}
8686

@@ -107,8 +107,8 @@ function parseWidths(toml: Toml.JsonMap, sink: CustomizerProps) {
107107
} else {
108108
widths.add(Gr.Width.Normal);
109109
}
110-
111-
return { ...sink, defaultWidthAtExpanded, widthGradesIncluded: widths };
110+
if (widths.size != 0) sink = { ...sink, defaultWidthAtExpanded, widthGradesIncluded: widths };
111+
return sink;
112112
}
113113

114114
function parseSlopes(toml: Toml.JsonMap, sink: CustomizerProps) {
@@ -120,7 +120,7 @@ function parseSlopes(toml: Toml.JsonMap, sink: CustomizerProps) {
120120
if (f.shape === v.shape) slopes.add(gr);
121121
}
122122
}
123-
sink = { ...sink, slopeGradesIncluded: slopes };
123+
if (slopes.size != 0) sink = { ...sink, slopeGradesIncluded: slopes };
124124
return sink;
125125
}
126126

0 commit comments

Comments
 (0)