fix: loading screen shows Forumlify on first visit + rotating tab title

- LoadingScreen: drop forumName title (default name flashed on first
  visit before settings loaded); show 🌊 logo + spinner instead
- AppProvider: during init rotate document.title Loading. → Loading..
  → Loading... every second; after ready show actual forum name
- layout: initial metadata title is 'Loading...' (client takes over)
This commit is contained in:
lezi-fun committed 2026-08-10 16:55:38 +08:00
1 parent 9880d2b0d0
commit e79c8530e3
5 files changed
+39 -5

No files matched your search

+20
View File
@@ -83,6 +83,26 @@ export default function AppProvider({ children }) {
init();
}, []);
// 页面标题:初始化中轮换 Loading. → Loading.. → Loading...,完成后显示论坛名
useEffect(() => {
if (!ready) {
const seq = ['Loading.', 'Loading..', 'Loading...'];
let i = 0;
document.title = seq[0];
const t = setInterval(() => {
i = (i + 1) % seq.length;
document.title = seq[i];
}, 1000);
return () => {
clearInterval(t);
};
}
// 初始化完成:标题恢复为论坛名
document.title = forumName;
const titleEl = document.querySelector('title');
if (titleEl) titleEl.textContent = forumName;
}, [ready, forumName]);
// 按 URL 参数初始化视图
useEffect(() => {
const params = new URLSearchParams(window.location.search);