refactor: remove unused UI notification functions and streamline initialization logic

This commit is contained in:
Tunglies
2026-04-06 01:14:42 +08:00
parent b8fbabae04
commit 04ce3d1772
5 changed files with 8 additions and 148 deletions
+1 -22
View File
@@ -1,8 +1,6 @@
use super::CmdResult;
use crate::core::{autostart, handle};
use crate::utils::resolve::ui::{self, UiReadyStage};
use crate::core::autostart;
use crate::{cmd::StringifyErr as _, feat, utils::dirs};
use clash_verge_logging::{Type, logging};
use smartstring::alias::String;
use tauri::{AppHandle, Manager as _};
@@ -109,22 +107,3 @@ pub async fn download_icon_cache(url: String, name: String) -> CmdResult<String>
pub async fn copy_icon_file(path: String, icon_info: feat::IconInfo) -> CmdResult<String> {
feat::copy_icon_file(path, icon_info).await
}
/// 通知UI已准备就绪
#[tauri::command]
pub async fn notify_ui_ready() {
logging!(info, Type::Cmd, "前端UI已准备就绪");
ui::mark_ui_ready();
handle::Handle::refresh_clash();
let delayed_refresh_delay = std::time::Duration::from_millis(1500);
tokio::time::sleep(delayed_refresh_delay).await;
handle::Handle::refresh_clash();
}
/// UI加载阶段
#[tauri::command]
pub fn update_ui_stage(stage: UiReadyStage) {
logging!(info, Type::Cmd, "UI加载阶段更新: {:?}", &stage);
ui::update_ui_ready_stage(stage);
}