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

This commit is contained in:
2026-06-11 16:06:36 +08:00
parent a6bc6941d4
commit e3d549d660
6 changed files with 30 additions and 66 deletions
+10 -1
View File
@@ -32,6 +32,14 @@ interface AuthState {
confirmPassword: string;
isLoading: boolean;
errorMessage: string | null;
/**
* 字段名 `isSuccess` 保留(接口兼容),语义改为:
* true = 用户**已登录**loginStatus ∈ {email, google, facebook, apple, guest}
* false = 未登录(loginStatus === "notLoggedIn"
*
* 之前用 `state.matches("success")` 当信号 —— 但 status check 流也会误入
* success,触发 splash-button 误跳 /chat。现改用 `loginStatus` 判定。
*/
isSuccess: boolean;
loginStatus: MachineContext["loginStatus"];
}
@@ -62,7 +70,8 @@ export function AuthProvider({ children }: AuthProviderProps) {
state.matches("loadingOAuth") ||
state.matches("loadingGuestLogin"),
errorMessage: state.context.errorMessage,
isSuccess: state.matches("success"),
// 改用 loginStatus 判断"已登录"(避开 success state 误触发)
isSuccess: state.context.loginStatus !== "notLoggedIn",
loginStatus: state.context.loginStatus,
}),
[state],