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) {
|
async executeCode(code?: string) {
|
||||||
await initPromise
|
await initPromise
|
||||||
await this?.engineCommandManager?.waitForReady
|
await this?.engineCommandManager?.waitForReady
|
||||||
|
if (!this?.engineCommandManager?.planesInitialized()) return
|
||||||
const result = await executeCode({
|
const result = await executeCode({
|
||||||
engineCommandManager,
|
engineCommandManager,
|
||||||
code: code || this._code,
|
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) => {}
|
onPlaneSelectCallback = (id: string) => {}
|
||||||
onPlaneSelected(callback: (id: string) => void) {
|
onPlaneSelected(callback: (id: string) => void) {
|
||||||
|
Reference in New Issue
Block a user