Mountain/IPC/WindServiceHandlers/NativeHost/
Reload.rs1
2use serde_json::Value;
7use tauri::{AppHandle, Manager};
8
9use crate::dev_log;
10
11pub async fn Fn(ApplicationHandle:AppHandle, _Arguments:Vec<Value>) -> Result<Value, String> {
12 dev_log!("lifecycle", "nativeHost:reload - reloading webview");
13
14 if let Some(Window) = ApplicationHandle.get_webview_window("main") {
15 Window
16 .eval("location.reload()")
17 .map_err(|E| format!("reload eval failed: {E}"))?;
18 }
19
20 Ok(Value::Null)
21}