feat: migrate tauri 2.0

This commit is contained in:
huzibaca
2024-09-04 08:54:15 +08:00
parent ae1c6d4617
commit b9be5e8c44
22 changed files with 842 additions and 14750 deletions

View File

@@ -36,8 +36,10 @@ impl CoreManager {
pub fn init(&self, app_handle: &AppHandle) -> Result<()> {
*self.app_handle.lock() = Some(app_handle.clone());
tauri::async_runtime::spawn(async {
log::trace!("run core start");
// 启动clash
log_err!(Self::global().run_core().await);
log::trace!("run core end");
});
Ok(())
@@ -69,9 +71,9 @@ impl CoreManager {
let test_dir = dirs::path_to_str(&test_dir)?;
let app_handle_option = {
let lock = self.app_handle.lock();
lock.as_ref().cloned()
lock.as_ref().cloned()
};
if let Some(app_handle) = app_handle_option {
let output = app_handle
.shell()