refactor: unify and simplify the call of app_handle

This commit is contained in:
huzibaca
2024-09-23 16:31:58 +08:00
parent 3d6faecaed
commit 1c894f3cfa
10 changed files with 135 additions and 158 deletions

View File

@@ -1,4 +1,5 @@
use crate::config::*;
use crate::core::handle;
use crate::utils::{dirs, help};
use anyhow::Result;
use chrono::{Local, TimeZone};
@@ -297,7 +298,9 @@ pub fn init_scheme() -> Result<()> {
Ok(())
}
pub async fn startup_script(app_handle: &AppHandle) -> Result<()> {
pub async fn startup_script() -> Result<()> {
let app_handle: AppHandle = handle::Handle::global().app_handle().unwrap();
let script_path = {
let verge = Config::verge();
let verge = verge.latest();