refactor: unify and simplify the call of app_handle(2)

This commit is contained in:
huzibaca
2024-09-23 23:15:51 +08:00
parent 961b86dcd2
commit 45b48ede44
12 changed files with 39 additions and 62 deletions

View File

@@ -11,7 +11,6 @@ use log4rs::encode::pattern::PatternEncoder;
use std::fs::{self, DirEntry};
use std::path::PathBuf;
use std::str::FromStr;
use tauri::AppHandle;
use tauri_plugin_shell::ShellExt;
/// initialize this instance's log file
@@ -299,7 +298,7 @@ pub fn init_scheme() -> Result<()> {
}
pub async fn startup_script() -> Result<()> {
let app_handle: AppHandle = handle::Handle::global().app_handle().unwrap();
let app_handle = handle::Handle::global().app_handle().unwrap();
let script_path = {
let verge = Config::verge();