only rust changes reset scene (#6060)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -85,6 +85,21 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
/// Reset the scene and bust the cache.
|
||||
/// ONLY use this if you absolutely need to reset the scene and bust the cache.
|
||||
#[wasm_bindgen(js_name = bustCacheAndResetScene)]
|
||||
pub async fn bust_cache_and_reset_scene(&self, settings: &str, path: Option<String>) -> Result<JsValue, String> {
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
let ctx = self.create_executor_ctx(settings, path, false)?;
|
||||
match ctx.bust_cache_and_reset_scene().await {
|
||||
// The serde-wasm-bindgen does not work here because of weird HashMap issues.
|
||||
// DO NOT USE serde_wasm_bindgen::to_value it will break the frontend.
|
||||
Ok(outcome) => JsValue::from_serde(&outcome).map_err(|e| e.to_string()),
|
||||
Err(err) => Err(serde_json::to_string(&err).map_err(|serde_err| serde_err.to_string())?),
|
||||
}
|
||||
}
|
||||
|
||||
/// Execute a program in mock mode.
|
||||
#[wasm_bindgen(js_name = executeMock)]
|
||||
pub async fn execute_mock(
|
||||
|
Reference in New Issue
Block a user