_
This commit is contained in:
		| @ -1,4 +1,4 @@ | ||||
| import * as EngineUtils from './engine-utils/engine.js' | ||||
| import EngineUtils from './engine-utils/engine.js' | ||||
|  | ||||
| type KCEngineUtilsEvaluatePath = { | ||||
|   (sketch: string, t: number): string | ||||
| @ -8,19 +8,14 @@ let kcEngineUtilsEvaluatePath: KCEngineUtilsEvaluatePath | ||||
| export async function init() { | ||||
|   return await new Promise((resolve, reject) => { | ||||
|     try { | ||||
|       kcEngineUtilsEvaluatePath = (s: string, t: number) => { | ||||
|         return 'it works' | ||||
|       } | ||||
|       resolve(true) | ||||
|  | ||||
|       // EngineUtils.Module().then(() => { | ||||
|       //   kcEngineUtilsEvaluatePath = EngineUtils.Module.cwrap( | ||||
|       //     'kcEngineCalcPathEndpoint', | ||||
|       //     'string', | ||||
|       //     ['string', 'number'] | ||||
|       //   ) | ||||
|       //   resolve(true) | ||||
|       // }) | ||||
|       EngineUtils().then((module) => { | ||||
|         kcEngineUtilsEvaluatePath = module.cwrap( | ||||
|           'kcEngineCalcPathEndpoint', | ||||
|           'string', | ||||
|           ['string', 'number'] | ||||
|         ) | ||||
|         resolve(true) | ||||
|       }) | ||||
|     } catch (e) { | ||||
|       reject(e) | ||||
|     } | ||||
|  | ||||
| @ -1548,16 +1548,19 @@ pub(crate) async fn inner_arc( | ||||
|                     }) | ||||
|                 })?; | ||||
|  | ||||
|                 //let str_result: Rc<RefCell<Option<String>>> = Rc::new(RefCell::new(None)); | ||||
|                 //let str_result0 = Rc::clone(&str_result); | ||||
|                 //wasm_bindgen_futures::spawn_local(async move { | ||||
|                     let promise = get_true_path_end_pos(sketch_json_value.into()).unwrap(); | ||||
|                     let result = crate::wasm::JsFuture::from(promise).await.unwrap(); | ||||
|                     web_sys::console::log_1(&format!("Inside here {result:?}").into()); | ||||
|                     //*str_result0.borrow_mut() = Some(result); | ||||
|                 //}); | ||||
|  | ||||
|                 //web_sys::console::log_1(&format!("Did this work? {str_result:?}").into()); | ||||
|                 let promise = get_true_path_end_pos(sketch_json_value.into()).map_err(|e| { | ||||
|                     KclError::Internal(KclErrorDetails { | ||||
|                         message: format!("{:?}", e), | ||||
|                         source_ranges: vec![args.source_range], | ||||
|                     }) | ||||
|                 })?; | ||||
|                 let result = crate::wasm::JsFuture::from(promise).await.map_err(|e| { | ||||
|                     KclError::Internal(KclErrorDetails { | ||||
|                         message: format!("{:?}", e), | ||||
|                         source_ranges: vec![args.source_range], | ||||
|                     }) | ||||
|                 })?; | ||||
|                 web_sys::console::log_1(&format!("Testing here {result:?}").into()); | ||||
|             } | ||||
|  | ||||
|             //duplicating engine logic to make sure this is _exactly_ what engine is doing - mike | ||||
|  | ||||
		Reference in New Issue
	
	Block a user