chore: update

This commit is contained in:
huzibaca
2024-09-02 19:33:17 +08:00
parent ad80d21e89
commit 6cc81fe6b8
42 changed files with 16683 additions and 2013 deletions

View File

@@ -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() {