Fix tsc and sketch error

This commit is contained in:
49lf
2024-08-13 10:05:57 -04:00
parent 2e60b6e1c8
commit 07a1582ea2
2 changed files with 2 additions and 2 deletions

View File

@ -591,7 +591,7 @@ export class SceneEntities {
const sg = kclManager.programMemory.get(
variableDeclarationName
) as SketchGroup
const lastSeg = sg.value.slice(-1)[0] || sg.start
const lastSeg = sg?.value?.slice(-1)[0] || sg.start
const index = sg.value.length // because we've added a new segment that's not in the memory yet, no need for `-1`

View File

@ -27,7 +27,7 @@ export class MachineManager {
// Start a background job to update the machines every ten seconds.
// If MDNS is already watching, this timeout will wait until it's done to trigger the
// finding again.
let timeoutId = undefined
let timeoutId: ReturnType<typeof setTimeout> | undefined = undefined
const timeoutLoop = () => {
clearTimeout(timeoutId)
timeoutId = setTimeout(async () => {