mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-20 19:12:09 +08:00
refactor: fix startup init chain — resolve_done semantics, dedupe events, cleanup
Backend: - Move resolve_done() from sync setup() to async task after futures::join! so Timer waits for actual init completion instead of firing immediately - Replace std::thread::sleep(50ms) with tokio::time::sleep in async context - Remove duplicate refresh_tray_menu in tray_init (keep post-join call only) - Delete dead code reset_resolve_done (process restarts, static is destroyed) - Rename create_window(is_show) → create_window(should_create) for clarity Frontend: - Remove duplicate verge://refresh-clash-config listener from AppDataProvider (useLayoutEvents handles it via invalidateQueries — single consumer path) - Stabilize useEffect deps with useRef for TQ refetch references - Simplify AppDataProvider event listener setup (profile-changed + proxy only)
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::{
|
||||
core::{CoreManager, handle, tray},
|
||||
feat::clean_async,
|
||||
process::AsyncHandler,
|
||||
utils::{self, resolve::reset_resolve_done},
|
||||
utils,
|
||||
};
|
||||
use clash_verge_logging::{Type, logging};
|
||||
use serde_yaml_ng::{Mapping, Value};
|
||||
@@ -42,7 +42,6 @@ pub async fn restart_app() {
|
||||
if cleanup_result { 0 } else { 1 }
|
||||
);
|
||||
|
||||
reset_resolve_done();
|
||||
let app_handle = handle::Handle::app_handle();
|
||||
app_handle.restart();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user