Skip to content

Commit 6f0726c

Browse files
fix: fix and build in ci
1 parent 1dbe06f commit 6f0726c

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
7-
# branches: ["main"]
7+
branches: ["feat/allinone"]
88

99
jobs:
1010

src/dialogs/GenerateMeshDialog.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function GenerateMeshDialog(props) {
4747
return [];
4848
}
4949
return Object.entries(layerSettings).reduce((prev, [key, val]) => {
50-
const count = project._layers.filter(layer => (layer.surface === key)).length;
50+
const count = project._layers?.filter(layer => (layer.surface === key))?.length || 0;
5151
return [
5252
...prev,
5353
{
@@ -199,7 +199,7 @@ export default function GenerateMeshDialog(props) {
199199

200200
{jobState.phase === 'settings' ? (
201201
<React.Fragment>
202-
<Alert sx={{ mb: 5 }}>Detected {project._layers.length} layers</Alert>
202+
<Alert sx={{ mb: 5 }}>Detected {project._layers?.length || 0} layers</Alert>
203203

204204
<Typography sx={{ mb: 3 }} variant="h3">Global Settings</Typography>
205205
{settingGroups.map(setting => (
@@ -277,7 +277,7 @@ export default function GenerateMeshDialog(props) {
277277
{jobState.status ? (
278278
<Typography>{jobState.status}</Typography>
279279
) : (
280-
<Typography>Generating {jobState.count} of {project._layers.length} meshes...</Typography>
280+
<Typography>Generating {jobState.count} of {project._layers?.length || 0} meshes...</Typography>
281281
)}
282282
</Stack>
283283
) : null}

src/pages/Course.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ export default function Course() {
259259
</Box>
260260
) : (
261261
<Stack sx={{ p: 3 }} spacing={3}>
262-
<Button onClick={handleGenerateMeshes} fullWidth variant="contained">Generate Meshes</Button>
262+
{project._layers?.length ? (
263+
<Button onClick={handleGenerateMeshes} fullWidth variant="contained">Generate Meshes</Button>
264+
) : (
265+
<Typography textAlign="center" color="textSecondary">You must generate an SVG before you can create meshes</Typography>
266+
)}
263267
</Stack>
264268
)}
265269
</Box>

0 commit comments

Comments
 (0)