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

This commit is contained in:
Lucas Fernandes Nogueira 2022-03-07 10:08:19 -03:00 committed by GitHub
parent 5293445f08
commit 9c65abce1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -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(())
}