mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
chore: update
This commit is contained in:
@@ -4,7 +4,7 @@ use anyhow::{bail, Result};
|
||||
use once_cell::sync::OnceCell;
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::Arc;
|
||||
use tauri::{AppHandle, Manager, Window};
|
||||
use tauri::{AppHandle, WebviewWindow, Manager, Emitter};
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct Handle {
|
||||
@@ -20,15 +20,15 @@ impl Handle {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn init(&self, app_handle: AppHandle) {
|
||||
*self.app_handle.lock() = Some(app_handle);
|
||||
pub fn init(&self, app_handle: &AppHandle) {
|
||||
*self.app_handle.lock() = Some(app_handle.clone());
|
||||
}
|
||||
|
||||
pub fn get_window(&self) -> Option<Window> {
|
||||
pub fn get_window(&self) -> Option<WebviewWindow> {
|
||||
self.app_handle
|
||||
.lock()
|
||||
.as_ref()
|
||||
.and_then(|a| a.get_window("main"))
|
||||
.and_then(|a| a.get_webview_window("main"))
|
||||
}
|
||||
|
||||
pub fn refresh_clash() {
|
||||
|
||||
Reference in New Issue
Block a user