Skip to main content

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

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