wait to execute code until planes are ready (#830)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -185,6 +185,7 @@ class KclManager {
|
||||
async executeCode(code?: string) {
|
||||
await initPromise
|
||||
await this?.engineCommandManager?.waitForReady
|
||||
if (!this?.engineCommandManager?.planesInitialized()) return
|
||||
const result = await executeCode({
|
||||
engineCommandManager,
|
||||
code: code || this._code,
|
||||
|
@ -1221,6 +1221,13 @@ export class EngineCommandManager {
|
||||
},
|
||||
})
|
||||
}
|
||||
planesInitialized(): boolean {
|
||||
return (
|
||||
this.defaultPlanes.xy !== '' &&
|
||||
this.defaultPlanes.yz !== '' &&
|
||||
this.defaultPlanes.xz !== ''
|
||||
)
|
||||
}
|
||||
|
||||
onPlaneSelectCallback = (id: string) => {}
|
||||
onPlaneSelected(callback: (id: string) => void) {
|
||||
|
Reference in New Issue
Block a user