Skip to content

Commit

Permalink
feat(core): run cleanup code on the relaunch API (#3629)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Mar 7, 2022
1 parent 5293445 commit 9c65abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/api-relaunch-cleanup.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Run `AppHandle` cleanup code before restarting the application on the `process > relaunch` API.
2 changes: 1 addition & 1 deletion core/tauri/src/endpoints/process.rs
Expand Up @@ -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(())
}

Expand Down

0 comments on commit 9c65abc

Please sign in to comment.