Skip to content
Snippets Groups Projects
Unverified Commit 6193a842 authored by GyDi's avatar GyDi
Browse files

feat: update tauri version

parent eb86b471
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -10,7 +10,7 @@ edition = "2021"
build = "build.rs"
[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }
tauri-build = { version = "1.0.0-rc.1", features = [] }
[dependencies]
dirs = "4.0.0"
......@@ -18,9 +18,7 @@ chrono = "0.4.19"
serde_json = "1.0"
serde_yaml = "0.8"
serde = { version = "1.0", features = ["derive"] }
# tauri = { version = "1.0.0-beta.8", features = ["api-all", "system-tray"] }
# tauri = { git = "https://github.com/tauri-apps/tauri", rev = "5e0d59ec", features = ["api-all", "system-tray"] }
tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next", features = ["api-all", "system-tray", "updater"] }
tauri = { version = "1.0.0-rc.1", features = ["api-all", "system-tray", "updater"] }
tauri-plugin-shadows = { git = "https://github.com/tauri-apps/tauri-plugin-shadows", features = ["tauri-impl"] }
tauri-plugin-vibrancy = { git = "https://github.com/tauri-apps/tauri-plugin-vibrancy", features = ["tauri-impl"] }
......
......@@ -105,7 +105,9 @@ impl Verge {
pub fn init_launch(&mut self, package_info: &tauri::PackageInfo) {
let app_name = "clash-verge";
let app_path = get_app_path(app_name);
let app_path = resource_dir(package_info).unwrap().join(app_path);
let app_path = resource_dir(package_info, &tauri::Env::default())
.unwrap()
.join(app_path);
let app_path = app_path.as_os_str().to_str().unwrap();
let auto = AutoLaunchBuilder::new()
......
......@@ -53,9 +53,9 @@ fn main() -> std::io::Result<()> {
}
}
"quit" => {
api::process::kill_children();
resolve::resolve_reset(app_handle);
app_handle.exit(0);
api::process::kill_children();
std::process::exit(0);
}
_ => {}
},
......@@ -94,12 +94,12 @@ fn main() -> std::io::Result<()> {
.build(tauri::generate_context!())
.expect("error while running tauri application")
.run(|app_handle, e| match e {
tauri::Event::CloseRequested { label, api, .. } => {
tauri::RunEvent::CloseRequested { label, api, .. } => {
let app_handle = app_handle.clone();
api.prevent_close();
app_handle.get_window(&label).unwrap().hide().unwrap();
}
tauri::Event::ExitRequested { .. } => {
tauri::RunEvent::ExitRequested { .. } => {
resolve::resolve_reset(app_handle);
api::process::kill_children();
}
......
use std::path::{Path, PathBuf};
use tauri::{
api::path::{home_dir, resource_dir},
PackageInfo,
Env, PackageInfo,
};
/// get the verge app home dir
......@@ -14,5 +14,7 @@ pub fn app_home_dir() -> PathBuf {
/// get the resources dir
pub fn app_resources_dir(package_info: &PackageInfo) -> PathBuf {
resource_dir(package_info).unwrap().join("resources")
resource_dir(package_info, &Env::default())
.unwrap()
.join("resources")
}
......@@ -54,7 +54,8 @@
"endpoints": [
"https://github.com/zzzgydi/clash-verge/releases/download/updater/update.json"
],
"dialog": false
"dialog": false,
"pubkey": ""
},
"allowlist": {
"all": true
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment