mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-30 18:52:12 +08:00
refactor: remove unused UI notification functions and streamline initialization logic
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user