selections fix follow up (#1019)
This commit is contained in:
@ -32,11 +32,10 @@ export function useEngineConnectionSubscriptions() {
|
|||||||
const unSubClick = engineCommandManager.subscribeTo({
|
const unSubClick = engineCommandManager.subscribeTo({
|
||||||
event: 'select_with_point',
|
event: 'select_with_point',
|
||||||
callback: async (engineEvent) => {
|
callback: async (engineEvent) => {
|
||||||
if (!context.sketchEnginePathId) return
|
|
||||||
const event = await getEventForSelectWithPoint(engineEvent, {
|
const event = await getEventForSelectWithPoint(engineEvent, {
|
||||||
sketchEnginePathId: context.sketchEnginePathId,
|
sketchEnginePathId: context.sketchEnginePathId,
|
||||||
})
|
})
|
||||||
send(event)
|
event && send(event)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -102,8 +102,8 @@ export async function getEventForSelectWithPoint(
|
|||||||
Models['OkModelingCmdResponse_type'],
|
Models['OkModelingCmdResponse_type'],
|
||||||
{ type: 'select_with_point' }
|
{ type: 'select_with_point' }
|
||||||
>,
|
>,
|
||||||
{ sketchEnginePathId }: { sketchEnginePathId: string }
|
{ sketchEnginePathId }: { sketchEnginePathId?: string }
|
||||||
): Promise<ModelingMachineEvent> {
|
): Promise<ModelingMachineEvent | null> {
|
||||||
if (!data?.entity_id) {
|
if (!data?.entity_id) {
|
||||||
return {
|
return {
|
||||||
type: 'Set selection',
|
type: 'Set selection',
|
||||||
@ -120,6 +120,7 @@ export async function getEventForSelectWithPoint(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!sketchEnginePathId) return null
|
||||||
// selected a vertex
|
// selected a vertex
|
||||||
const res = await engineCommandManager.sendSceneCommand({
|
const res = await engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
|
Reference in New Issue
Block a user