mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-02 04:42:09 +08:00
refactor: eliminate startup flicker — defer window show until overlay renders
- Remove Rust-side `eval(INITIAL_LOADING_OVERLAY)` that prematurely dismissed the overlay before React/MUI theme was ready - Defer `window.show()` from Rust `activate_window` to an inline `<script>` in index.html, executed after the themed overlay is in DOM - Remove `useAppInitialization` hook (duplicate of `useLoadingOverlay` with no themeReady gate) - Simplify overlay to pure theme-colored background — no spinner or loading text — so fast startup feels instant - Simplify `hideInitialOverlay` API and reduce overlay fade to 0.2s - Clean up unused CSS variables (spinner-track, spinner-top, etc.)
This commit is contained in:
@@ -91,11 +91,3 @@ pub const WINDOW_INITIAL_SCRIPT: &str = r##"
|
||||
|
||||
console.log('[Tauri] 窗口初始化脚本执行完成');
|
||||
"##;
|
||||
|
||||
pub const INITIAL_LOADING_OVERLAY: &str = r"
|
||||
const overlay = document.getElementById('initial-loading-overlay');
|
||||
if (overlay) {
|
||||
overlay.style.opacity = '0';
|
||||
setTimeout(() => overlay.remove(), 300);
|
||||
}
|
||||
";
|
||||
|
||||
Reference in New Issue
Block a user