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.
- package/README.md +41 -26
- package/dist/cli.js +4 -4
- package/package.json +3 -3
- package/src-tauri/Cargo.lock +516 -4
- package/src-tauri/Cargo.toml +2 -1
- package/src-tauri/gen/schemas/windows-schema.json +2326 -0
- package/src-tauri/src/lib.rs +9 -14
package/src-tauri/src/lib.rs
CHANGED
|
@@ -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(|
|
|
104
|
-
|
|
105
|
-
|
|
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
|
|
112
|
-
|
|
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
|
-
|
|
117
|
-
|
|
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
|
})
|