Skip to main content

Mountain/RPC/CocoonService/GenericRequest/WindowDialogs/
OpenExternal.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 Url = Params
10		.as_str()
11		.or_else(|| Params.get("url").and_then(|V| V.as_str()))
12		.unwrap_or("")
13		.to_string();
14
15	let _ = Env.ApplicationHandle.emit("sky://native/openExternal", json!({ "url": Url }));
16
17	super::super::FileSystem::OkResponse(RequestId, &json!({ "success": true }))
18}