From 66616ff23cfb17603ff721f75406a76df9f6b3fe Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 21 Dec 2024 22:25:26 +0800 Subject: [PATCH] :bug: debug windows close --- dist/cli.js | 8 ++++---- package.json | 6 +++--- src-tauri/Cargo.lock | 8 ++++---- src-tauri/Cargo.toml | 2 +- src-tauri/src/app/menu.rs | 2 +- src-tauri/src/lib.rs | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/cli.js b/dist/cli.js index 5dd693de0..5f89292aa 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -20,7 +20,7 @@ import * as psl from 'psl'; import isUrl from 'is-url'; var name = "pake-cli"; -var version$1 = "3.0.1"; +var version$1 = "3.0.2"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。"; var engines = { node: ">=16.0.0" @@ -70,7 +70,7 @@ var dependencies = { "@tauri-apps/api": "^1.6.0", "@tauri-apps/cli": "^2.1.0", axios: "^1.7.9", - chalk: "^5.3.0", + chalk: "^5.4.0", commander: "^11.1.0", "file-type": "^18.7.0", "fs-extra": "^11.2.0", @@ -100,7 +100,7 @@ var devDependencies = { "@types/update-notifier": "^6.0.8", "app-root-path": "^3.1.0", "cross-env": "^7.0.3", - rollup: "^4.28.1", + rollup: "^4.29.1", "rollup-plugin-typescript2": "^0.36.0", tslib: "^2.8.1", typescript: "^5.7.2" @@ -381,7 +381,7 @@ async function isChinaIP(ip, domain) { try { const delay = await ping(ip); logger.debug(`${domain} latency is ${delay} ms`); - return delay > 500; + return delay > 1000; } catch (error) { logger.debug(`ping ${domain} failed!`); diff --git a/package.json b/package.json index ea4fe2c76..3a3f0136b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "3.0.1", + "version": "3.0.2", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。", "engines": { "node": ">=16.0.0" @@ -50,7 +50,7 @@ "@tauri-apps/api": "^1.6.0", "@tauri-apps/cli": "^2.1.0", "axios": "^1.7.9", - "chalk": "^5.3.0", + "chalk": "^5.4.0", "commander": "^11.1.0", "file-type": "^18.7.0", "fs-extra": "^11.2.0", @@ -80,7 +80,7 @@ "@types/update-notifier": "^6.0.8", "app-root-path": "^3.1.0", "cross-env": "^7.0.3", - "rollup": "^4.28.1", + "rollup": "^4.29.1", "rollup-plugin-typescript2": "^0.36.0", "tslib": "^2.8.1", "typescript": "^5.7.2" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 686d7571b..0bb958b12 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3393,9 +3393,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -3413,9 +3413,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 358ebba62..68a0f64a6 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -19,7 +19,7 @@ tauri-build = { version = "2.0.3", features = [] } [dependencies] serde_json = "1.0.133" -serde = { version = "1.0.215", features = ["derive"] } +serde = { version = "1.0.216", features = ["derive"] } tauri = { version = "2.1.1", features = ["tray-icon", "image-ico", "image-png", "macos-proxy"] } tauri-plugin-window-state = "2.2.0" tauri-plugin-oauth = "2" diff --git a/src-tauri/src/app/menu.rs b/src-tauri/src/app/menu.rs index d2b42015b..f19cf493c 100644 --- a/src-tauri/src/app/menu.rs +++ b/src-tauri/src/app/menu.rs @@ -24,7 +24,7 @@ pub fn set_system_tray(app: &AppHandle) -> tauri::Result<()> { } "quit" => { let _res = app.save_window_state(StateFlags::all()); - std::process::exit(0); + app.get_webview_window("pake").unwrap().close().unwrap(); } _ => (), }) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 1fac8565a..672a235da 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -120,7 +120,7 @@ pub fn run_app() { } #[cfg(not(target_os = "macos"))] - window.destroy().unwrap(); + std::process::exit(0); } }) .run(tauri::generate_context!())