pake-cli 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,7 @@ pub fn run_app() {
38
38
  .plugin(tauri_plugin_oauth::init())
39
39
  .plugin(tauri_plugin_http::init())
40
40
  .plugin(tauri_plugin_shell::init())
41
+ .plugin(tauri_plugin_single_instance::init(|_, _, _| ()))
41
42
  .invoke_handler(tauri::generate_handler![
42
43
  download_file,
43
44
  download_file_by_binary
@@ -100,27 +101,21 @@ pub fn run_app() {
100
101
 
101
102
  Ok(())
102
103
  })
103
- .on_window_event(|window, event| {
104
- if let tauri::WindowEvent::CloseRequested { api, .. } = event {
105
- let window = window.clone();
106
-
107
- #[cfg(target_os = "macos")]
104
+ .on_window_event(|_window, _event| {
105
+ #[cfg(target_os = "macos")]
106
+ if let tauri::WindowEvent::CloseRequested { api, .. } = _event {
107
+ let window = _window.clone();
108
108
  {
109
- let window_handle = window.clone();
110
109
  tauri::async_runtime::spawn(async move {
111
- if window_handle.is_fullscreen().unwrap_or(false) {
112
- window_handle.set_fullscreen(false).unwrap();
110
+ if window.is_fullscreen().unwrap_or(false) {
111
+ window.set_fullscreen(false).unwrap();
113
112
  // Give a small delay to ensure the full-screen exit operation is completed.
114
113
  tokio::time::sleep(Duration::from_millis(900)).await;
115
114
  }
116
- window_handle.minimize().unwrap();
117
- window_handle.hide().unwrap();
115
+ window.minimize().unwrap();
116
+ window.hide().unwrap();
118
117
  });
119
118
  }
120
-
121
- #[cfg(not(target_os = "macos"))]
122
- window.close().unwrap();
123
-
124
119
  api.prevent_close();
125
120
  }
126
121
  })