refactor(chat): remove legacy screen visibility events and use absolute state refs
- Remove ChatScreenVisible and ChatScreenInvisible events from chat state machine - Remove legacy ChatInit event handler - Migrate state transitions to use absolute references (#chat.guestSession, #chat.userSession, #chat.idle) - Adjust legal text wording for Cozsweet privacy agreement
This commit is contained in:
@@ -32,14 +32,14 @@ export function AuthLegalText() {
|
||||
{checked ? <span className={styles.checkboxInner} /> : null}
|
||||
</button>
|
||||
<p className={styles.text}>
|
||||
I agree to the{" "}
|
||||
I agree to the Cozsweet {" "}
|
||||
<a
|
||||
href={AppConstants.privacyPolicyUrl}
|
||||
className={styles.link}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Cozsweet Privacy Agreement
|
||||
Privacy Agreement
|
||||
</a>{" "}
|
||||
and{" "}
|
||||
<a
|
||||
|
||||
@@ -96,10 +96,8 @@ export function ChatScreen() {
|
||||
// 屏幕生命周期 + 派初次鉴权生命周期事件
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
useEffect(() => {
|
||||
chatDispatch({ type: "ChatScreenVisible" });
|
||||
dispatchAuthLifecycle(authState.loginStatus, chatDispatch);
|
||||
return () => {
|
||||
chatDispatch({ type: "ChatScreenInvisible" });
|
||||
};
|
||||
// 注:mount useEffect 故意**不**依赖 loginStatus —— 首次 mount 时机是固定的
|
||||
// ("用户进 /chat 那一刻"),loginStatus 由 splash/auth-screen 提前 settle。
|
||||
|
||||
Reference in New Issue
Block a user