Skip to main content

Mountain/RPC/CocoonService/GenericNotification/SkyEmit/
ProgressStart.rs

1#![allow(unused_variables, dead_code, unused_imports)]
2
3use serde_json::{Value, json};
4use tauri::Emitter;
5
6use crate::Environment::MountainEnvironment::MountainEnvironment;
7
8pub fn Fn(Params:Value, Env:&MountainEnvironment) {
9	let Id = Params.get("id").and_then(|V| V.as_str()).unwrap_or("").to_string();
10
11	let Title = Params.get("title").and_then(|V| V.as_str()).map(|S| S.to_string());
12
13	let Location = Params.get("location").cloned();
14
15	let Cancellable = Params.get("cancellable").and_then(|V| V.as_bool()).unwrap_or(false);
16
17	let _ = Env.ApplicationHandle.emit(
18		"sky://progress/start",
19		json!({ "id": Id, "title": Title, "location": Location, "cancellable": Cancellable }),
20	);
21}