Skip to main content

Mountain/RPC/CocoonService/GenericRequest/WindowDialogs/
SetStatusBarText.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 ItemId = Params.get("itemId").and_then(|V| V.as_str()).unwrap_or("").to_string();
10
11	let Text = Params.get("text").and_then(|V| V.as_str()).unwrap_or("").to_string();
12
13	let _ = Env
14		.ApplicationHandle
15		.emit("sky://statusbar/update", json!({ "id": ItemId, "text": Text }));
16
17	super::super::FileSystem::OkResponse(RequestId, &json!({ "success": true }))
18}