Skip to main content

Mountain/RPC/CocoonService/GenericRequest/WindowDialogs/
SetWebviewHtml.rs

1use serde_json::{Value, json};
2use tauri::Emitter;
3use tonic::Response;
4use ::Vine::Generated::GenericResponse;
5
6use crate::Environment::MountainEnvironment::MountainEnvironment;
7
8pub fn Fn(RequestId:u64, Params:Value, Env:&MountainEnvironment) -> Response<GenericResponse> {
9	let Handle = Params.get("handle").and_then(|V| V.as_u64()).unwrap_or(0);
10
11	let Html = Params.get("html").and_then(|V| V.as_str()).unwrap_or("").to_string();
12
13	let _ = Env
14		.ApplicationHandle
15		.emit("sky://webview/set-html", json!({ "handle": Handle, "html": Html }));
16
17	super::super::FileSystem::OkResponse(RequestId, &json!({ "success": true }))
18}