mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 05:20:28 +08:00
- 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.)
18 lines
380 B
TypeScript
18 lines
380 B
TypeScript
let removed = false
|
|
|
|
export const hideInitialOverlay = (): number | undefined => {
|
|
if (removed) return undefined
|
|
|
|
const overlay = document.getElementById('initial-loading-overlay')
|
|
if (!overlay) {
|
|
removed = true
|
|
return undefined
|
|
}
|
|
|
|
removed = true
|
|
overlay.dataset.hidden = 'true'
|
|
|
|
const timer = window.setTimeout(() => overlay.remove(), 200)
|
|
return timer
|
|
}
|