Skip to content

Commit

Permalink
fix(service): service was being closed on exit code 1
Browse files Browse the repository at this point in the history
  • Loading branch information
eythaann committed Dec 19, 2024
1 parent 915837a commit 2cbf363
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## [Unreleased]
### fix
- slu-service was being closed on exit code 1.

## [2.0.12]
### fix
- msix version crashing on start.
Expand Down
15 changes: 9 additions & 6 deletions src/background/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,18 @@ fn setup(app: &mut tauri::App<tauri::Wry>) -> Result<()> {

fn app_callback(_: &tauri::AppHandle<tauri::Wry>, event: tauri::RunEvent) {
match event {
tauri::RunEvent::ExitRequested { api, code, .. } => {
// prevent close background on webview windows closing
if code.is_none() {
api.prevent_exit();
tauri::RunEvent::ExitRequested { api, code, .. } => match code {
Some(code) => {
if code == 0 {
// if exit code is 0 it means that the app was closed by the user
log_error!(kill_slu_service());
}
}
}
// prevent close background on webview windows closing
None => api.prevent_exit(),
},
tauri::RunEvent::Exit => {
log::info!("───────────────────── Exiting Seelen UI ─────────────────────");
log_error!(kill_slu_service());
if Seelen::is_running() {
trace_lock!(SEELEN).stop();
}
Expand Down

0 comments on commit 2cbf363

Please sign in to comment.