chore: clean up interpreter and bindings

This commit is contained in:
Jonathan Kelley committed 2022-12-05 16:47:04 -08:00
1 parent 7b1cdb7d85
commit b182a6ee75
17 files changed
+34 -108

No files matched your search

+2 -6
View File
@@ -76,12 +76,8 @@ impl DesktopController {
.render_with_deadline(tokio::time::sleep(Duration::from_millis(16)))
.await;
{
let mut queue = edit_queue.lock().unwrap();
queue.push(serde_json::to_string(&muts.templates).unwrap());
queue.push(serde_json::to_string(&muts.edits).unwrap());
let _ = proxy.send_event(UserWindowEvent::EditsReady);
}
edit_queue.lock().unwrap().push(serde_json::to_string(&muts).unwrap());
let _ = proxy.send_event(UserWindowEvent::EditsReady);
}
})
});
-2
View File
@@ -211,8 +211,6 @@ pub(super) fn handler(
};
let window = webview.window();
println!("user_event: {:?}", user_event);
match user_event {
Initialize | EditsReady => desktop.try_load_ready_webviews(),
CloseWindow => *control_flow = ControlFlow::Exit,
-1
View File
@@ -42,7 +42,6 @@ macro_rules! match_data {
) => {
match $name {
$( $($mname)|* => {
println!("casting to type {:?}", std::any::TypeId::of::<$tip>());
let val: $tip = from_value::<$tip>($m).ok()?;
Rc::new(val) as Rc<dyn Any>
})*
+5 -4
View File
@@ -1,19 +1,20 @@
use dioxus_core::VirtualDom;
use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};
use interprocess::local_socket::LocalSocketStream;
// use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};
use std::io::{BufRead, BufReader};
use std::time::Duration;
use std::{sync::Arc, sync::Mutex};
fn handle_error(connection: std::io::Result<LocalSocketStream>) -> Option<LocalSocketStream> {
fn _handle_error(connection: std::io::Result<LocalSocketStream>) -> Option<LocalSocketStream> {
connection
.map_err(|error| eprintln!("Incoming connection failed: {}", error))
.ok()
}
pub(crate) fn init(dom: &VirtualDom) {
pub(crate) fn _init(_dom: &VirtualDom) {
let latest_in_connection: Arc<Mutex<Option<BufReader<LocalSocketStream>>>> =
Arc::new(Mutex::new(None));
let latest_in_connection_handle = latest_in_connection.clone();
let _latest_in_connection_handle = latest_in_connection.clone();
// connect to processes for incoming data
std::thread::spawn(move || {
-1
View File
@@ -153,7 +153,6 @@ pub fn launch_with_props<P: 'static + Send>(root: Component<P>, props: P, mut cf
}
"initialize" => {
is_ready.store(true, std::sync::atomic::Ordering::Relaxed);
println!("initializing...");
let _ = proxy.send_event(UserWindowEvent::EditsReady);
}
"browser_open" => {