fix:splash 界面重定向界面问题

This commit is contained in:
2026-06-11 17:00:04 +08:00
parent e3d549d660
commit 1151a9a61b
7 changed files with 144 additions and 94 deletions
+10
View File
@@ -17,6 +17,15 @@ export interface AuthState {
errorMessage: string | null;
/** 当前登录状态(未登录 / 游客 / OAuth / 邮箱) */
loginStatus: LoginStatus;
/**
* **一次性的"刚按了"信号** —— Skip / Facebook / 邮箱登录按钮**刚**派事件 → 置 true
* → splash-screen / auth-screen 看到 `pendingRedirect && loginStatus !== "notLoggedIn"` 触发跳转
* → 跳完置 false
*
* 历史:之前用 useRef 做 transition detection**但** re-mount 时 ref 重置,bug 复发。
* 现**在 auth state 里持久**machine 不重置)—— re-mount 时也能区分"刚按"和"历史"。
*/
pendingRedirect: boolean;
}
export const initialState: AuthState = {
@@ -28,4 +37,5 @@ export const initialState: AuthState = {
confirmPassword: "",
errorMessage: null,
loginStatus: "notLoggedIn",
pendingRedirect: false,
};