refactor(auth): simplify splash guest entry
This commit is contained in:
@@ -17,15 +17,6 @@ export interface AuthState {
|
||||
loginStatus: LoginStatus;
|
||||
/** 启动时的本地登录态恢复是否已经完成 */
|
||||
hasInitialized: boolean;
|
||||
/**
|
||||
* 一次性的"刚按了"信号 —— 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 = {
|
||||
@@ -38,5 +29,4 @@ export const initialState: AuthState = {
|
||||
errorMessage: null,
|
||||
loginStatus: "notLoggedIn",
|
||||
hasInitialized: false,
|
||||
pendingRedirect: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user