mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: the shortcut key to exit cannot be used
This commit is contained in:
@@ -16,7 +16,7 @@ use tauri_plugin_clipboard_manager::ClipboardExt;
|
||||
// 打开面板
|
||||
pub fn open_or_close_dashboard() {
|
||||
let handle = handle::Handle::global();
|
||||
let app_handle = handle.app_handle.lock();
|
||||
let app_handle = handle.app_handle.lock().clone();
|
||||
if let Some(app_handle) = app_handle.as_ref() {
|
||||
if let Some(window) = app_handle.get_webview_window("main") {
|
||||
if let Ok(true) = window.is_focused() {
|
||||
@@ -103,6 +103,17 @@ pub fn toggle_tun_mode() {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn quit() {
|
||||
let handle = handle::Handle::global();
|
||||
let app_handle = handle.app_handle.lock().clone();
|
||||
if let Some(app_handle) = app_handle.as_ref() {
|
||||
let _ = resolve::save_window_size_position(&app_handle, true);
|
||||
resolve::resolve_reset();
|
||||
app_handle.exit(0);
|
||||
std::process::exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// 修改clash的订阅
|
||||
pub async fn patch_clash(patch: Mapping) -> Result<()> {
|
||||
Config::clash().draft().patch_config(patch.clone());
|
||||
|
||||
Reference in New Issue
Block a user