Mountain/RPC/CocoonService/Window/
OpenExternal.rs1
2use serde_json::json;
7use tauri::Emitter;
8use tonic::{Response, Status};
9
10use crate::{
11 RPC::CocoonService::CocoonServiceImpl,
12 Vine::Generated::{Empty, OpenExternalRequest},
13 dev_log,
14};
15
16pub async fn Fn(Service:&CocoonServiceImpl, Request:OpenExternalRequest) -> Result<Response<Empty>, Status> {
17 dev_log!("cocoon", "[CocoonService] open_external: {}", Request.uri);
18
19 let _ = Service
20 .environment
21 .ApplicationHandle
22 .emit("sky://native/openExternal", json!({ "url": Request.uri }));
23
24 Ok(Response::new(Empty {}))
25}