Vine/Server/Notification/
UnregisterCommand.rs1use serde_json::{Value, json};
8
9use crate::{Host::VineHost, dev_log};
10
11pub async fn UnregisterCommand(Host:&dyn VineHost, Parameter:&Value) {
12 let CommandId = Parameter.get("commandId").and_then(Value::as_str).unwrap_or("");
13
14 if CommandId.is_empty() {
15 return;
16 }
17
18 Host.UnregisterCommandInRegistry(CommandId);
19
20 dev_log!("command-register", "[UnregisterCommand] id={}", CommandId);
21
22 Host.EmitToRenderer("sky://command/unregister", json!({ "id": CommandId, "commandId": CommandId }));
23}