perf(startup): instant splash, cached home and non-blocking auth
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Renders a static branded splash immediately, restores the last user/API session from disk, hydrates home/library queries from localStorage, shows a home skeleton while the first request runs, drops blocking auth network checks, and redirects a streamless /player to home.
This commit is contained in:
1 parent
b1d9b40def
commit
205b655d00
12 files changed
+424
-158
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
/**
|
||||
* Hides the static HTML splash once React has mounted the app shell.
|
||||
* Keeping it in the DOM until this point avoids a blank window while the
|
||||
* Tauri store/API session is being restored.
|
||||
*/
|
||||
const SplashHider = () => {
|
||||
useEffect(() => {
|
||||
const splash = document.querySelector(".app-loading");
|
||||
if (!splash) return;
|
||||
|
||||
// The effect runs after React committed the app shell; the static
|
||||
// splash has done its job and can fade out immediately.
|
||||
splash.classList.add("hidden");
|
||||
if (import.meta.env.DEV) performance.mark("blink:splash-hidden");
|
||||
const timer = window.setTimeout(() => splash.remove(), 260);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default SplashHider;
|
||||
Reference in new issue
Block a user