Skip to main content

Mountain/Vine/Server/Notification/
WebviewDispose.rs

1//! Cocoon → Mountain `webview.dispose` notification.
2//! Emitted by `Cocoon/.../Services/Window/WebviewPanel.ts:155` when the
3//! extension disposes a webview panel or the user closes the tab. Sky's
4//! webview shim listens on `sky://webview/dispose` and tears down the
5//! DOM container + unregisters the handle lookup.
6
7use serde_json::Value;
8use tauri::Emitter;
9
10use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
11
12pub async fn WebviewDispose(Service:&MountainVinegRPCService, Parameter:&Value) {
13	let _ = Service.ApplicationHandle().emit("sky://webview/dispose", Parameter);
14
15	dev_log!(
16		"grpc",
17		"[Webview] dispose handle={}",
18		Parameter.get("handle").and_then(Value::as_str).unwrap_or("?")
19	);
20}