Skip to content

Commit 8d2e3dc

Browse files
committed
feat(GcodePreview): ignore colors when no tools
Signed-off-by: Pedro Lamas <[email protected]>
1 parent 1633c47 commit 8d2e3dc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/store/gcodePreview/getters.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,15 @@ export const getters = {
187187
},
188188

189189
getToolColors: (state, getters): Record<Tool, string> => {
190-
const colorsFromFileMetadata: string[] = getters.getFileFilamentColors
191-
192-
const toolIndexes = state.tools.length === 0
193-
? [0]
194-
: state.tools
190+
const [toolIndexes, colorsFromFileMetadata]: [number[], string[]] = state.tools.length === 0
191+
? [
192+
[0],
193+
[]
194+
]
195+
: [
196+
state.tools,
197+
getters.getFileFilamentColors
198+
]
195199

196200
const defaultColors: string[] = getters.getDefaultColors
197201

0 commit comments

Comments
 (0)