From 9b7cc7afa4eb76acc9ee338b82d21c34e7798eeb Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Fri, 13 Oct 2023 10:27:25 +1100 Subject: [PATCH] save path id on path create (#849) --- src/components/ModelingMachineProvider.tsx | 16 ++++++++-------- src/lang/std/engineConnection.ts | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/ModelingMachineProvider.tsx b/src/components/ModelingMachineProvider.tsx index f6f0bfcb6..a65d13ecf 100644 --- a/src/components/ModelingMachineProvider.tsx +++ b/src/components/ModelingMachineProvider.tsx @@ -83,16 +83,16 @@ export const ModelingMachineProvider = ({ 'show default planes': () => { kclManager.showPlanes() }, - 'create path': async () => { - const sketchUuid = uuidv4() - const proms = [ + 'create path': assign({ + sketchEnginePathId: () => { + const sketchUuid = uuidv4() engineCommandManager.sendSceneCommand({ type: 'modeling_cmd_req', cmd_id: sketchUuid, cmd: { type: 'start_path', }, - }), + }) engineCommandManager.sendSceneCommand({ type: 'modeling_cmd_req', cmd_id: uuidv4(), @@ -100,10 +100,10 @@ export const ModelingMachineProvider = ({ type: 'edit_mode_enter', target: sketchUuid, }, - }), - ] - await Promise.all(proms) - }, + }) + return sketchUuid + }, + }), 'AST start new sketch': assign((_, { data: { coords, axis } }) => { // Something really weird must have happened for this to happen. if (!axis) { diff --git a/src/lang/std/engineConnection.ts b/src/lang/std/engineConnection.ts index d6997f77a..898e53c7d 100644 --- a/src/lang/std/engineConnection.ts +++ b/src/lang/std/engineConnection.ts @@ -765,7 +765,6 @@ export class EngineCommandManager { streamWidth: number streamHeight: number }) { - console.log('handleResize', streamWidth, streamHeight) if (!this.engineConnection?.isReady()) { return }