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:
Tunglies
2026-04-06 12:20:16 +08:00
parent 437fef1c30
commit 3aa39bff94
5 changed files with 29 additions and 128 deletions
-1
View File
@@ -251,7 +251,6 @@ pub fn run() {
resolve::resolve_setup_async();
resolve::resolve_setup_sync();
resolve::init_signal();
resolve::resolve_done();
logging!(info, Type::Setup, "初始化已启动");
Ok(())