Przeglądaj źródła

feat(core): run cleanup code on the relaunch API (#3629)

Lucas Fernandes Nogueira 3 lat temu
rodzic
commit
9c65abce1b

+ 5 - 0
.changes/api-relaunch-cleanup.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Run `AppHandle` cleanup code before restarting the application on the `process > relaunch` API.

+ 1 - 1
core/tauri/src/endpoints/process.rs

@@ -23,7 +23,7 @@ pub enum Cmd {
 impl Cmd {
   #[module_command_handler(process_relaunch, "process > relaunch")]
   fn relaunch<R: Runtime>(context: InvokeContext<R>) -> super::Result<()> {
-    crate::api::process::restart(&context.window.state());
+    context.window.app_handle().restart();
     Ok(())
   }