Skip to main content

Mountain/Vine/Server/Notification/
WebviewDispose.rs

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