diff --git a/packages/desktop/src/app.rs b/packages/desktop/src/app.rs index 73f947541..56bd0b417 100644 --- a/packages/desktop/src/app.rs +++ b/packages/desktop/src/app.rs @@ -302,16 +302,6 @@ impl App { _ = self.shared.proxy.send_event(UserWindowEvent::Poll(id)); } - /// Todo: maybe we should poll the virtualdom asking if it has any final actions to apply before closing the webview - /// - /// Technically you can handle this with the use_window_event hook - pub fn handle_close_msg(&mut self, id: WindowId) { - self.webviews.remove(&id); - if self.webviews.is_empty() { - self.control_flow = ControlFlow::Exit - } - } - pub fn handle_query_msg(&mut self, msg: IpcMessage, id: WindowId) { let Ok(result) = serde_json::from_value::(msg.params()) else { return; diff --git a/packages/desktop/src/launch.rs b/packages/desktop/src/launch.rs index 1591806d5..11e9f0687 100644 --- a/packages/desktop/src/launch.rs +++ b/packages/desktop/src/launch.rs @@ -39,7 +39,7 @@ pub fn launch_virtual_dom_blocking(virtual_dom: VirtualDom, mut desktop_config: Event::UserEvent(event) => match event { UserWindowEvent::Poll(id) => app.poll_vdom(id), UserWindowEvent::NewWindow => app.handle_new_window(), - UserWindowEvent::CloseWindow(id) => app.handle_close_msg(id), + UserWindowEvent::CloseWindow(id) => app.handle_close_requested(id), UserWindowEvent::Shutdown => app.control_flow = tao::event_loop::ControlFlow::Exit, #[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]