feat: update to alpha.11 (#555)

This commit is contained in:
Lucas Fernandes Nogueira
2023-08-14 10:51:20 -07:00
committed by GitHub
parent d5a7c77a8d
commit d74fc0a097
67 changed files with 629 additions and 539 deletions
+3 -6
View File
@@ -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);
}
});