mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-02 15:45:31 +02:00
feat: update to alpha.11 (#555)
This commit is contained in:
committed by
GitHub
parent
d5a7c77a8d
commit
d74fc0a097
@@ -6,7 +6,7 @@ use std::{collections::HashMap, path::PathBuf, string::FromUtf8Error};
|
||||
|
||||
use encoding_rs::Encoding;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{api::ipc::CallbackFn, Manager, Runtime, State, Window};
|
||||
use tauri::{ipc::Channel, Manager, Runtime, State, Window};
|
||||
|
||||
use crate::{
|
||||
open::Program,
|
||||
@@ -97,7 +97,7 @@ pub fn execute<R: Runtime>(
|
||||
shell: State<'_, Shell<R>>,
|
||||
program: String,
|
||||
args: ExecuteArgs,
|
||||
on_event_fn: CallbackFn,
|
||||
on_event: Channel,
|
||||
options: CommandOptions,
|
||||
) -> crate::Result<ChildId> {
|
||||
let mut command = if options.sidecar {
|
||||
@@ -166,10 +166,7 @@ pub fn execute<R: Runtime>(
|
||||
children.lock().unwrap().remove(&pid);
|
||||
};
|
||||
let js_event = JSCommandEvent::new(event, encoding);
|
||||
let js = tauri::api::ipc::format_callback(on_event_fn, &js_event)
|
||||
.expect("unable to serialize CommandEvent");
|
||||
|
||||
let _ = window.eval(js.as_str());
|
||||
let _ = on_event.send(&js_event);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user