Skip to main content

Mountain/Vine/Server/Notification/
ProgressEnd.rs

1#![allow(non_snake_case)]
2//! Cocoon → Mountain `progress.end` notification.
3//! Fires once per `vscode.window.withProgress(...)` call when the task
4//! settles. Forwarded onto `sky://notification/progress-end` so Sky's
5//! progress indicator tears down.
6
7use serde_json::{Value, json};
8use tauri::Emitter;
9
10use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
11
12pub async fn ProgressEnd(Service:&MountainVinegRPCService, Parameter:&Value) {
13	let Handle = Parameter.get("handle").and_then(Value::as_str).unwrap_or("");
14	if let Err(Error) = Service
15		.ApplicationHandle()
16		.emit("sky://notification/progress-end", json!({ "id": Handle }))
17	{
18		dev_log!(
19			"grpc",
20			"warn: [MountainVinegRPCService] sky://notification/progress-end emit failed: {}",
21			Error
22		);
23	}
24}