Bug fix: prevent KCL error due to colliding AST execution on project switch (#3205)

* Only run "Execute AST" action if defaultUnit setting changes

* A little more logging and catching anywhere we call video.play()
This commit is contained in:
Frank Noirot
2024-08-01 01:40:14 -04:00
committed by GitHub
parent 41b1ec94fa
commit 1ac39d95f2
5 changed files with 55 additions and 10 deletions

View File

@ -224,6 +224,7 @@ export class KclManager {
sceneInfra.modelingSend({ type: 'code edit during sketch' })
defaultSelectionFilter(programMemory, this.engineCommandManager)
await this.engineCommandManager.waitForAllCommands()
if (zoomToFit) {
let zoomObjectId: string | undefined = ''
@ -243,6 +244,15 @@ export class KclManager {
padding: 0.1, // padding around the objects
},
})
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'zoom_to_fit',
object_ids: zoomObjectId ? [zoomObjectId] : [], // leave empty to zoom to all objects
padding: 0.1, // padding around the objects
},
})
}
this.isExecuting = false