fix(e2e): stabilize authenticated unlock flows
This commit is contained in:
@@ -34,14 +34,15 @@ export function ChatAuthSync() {
|
||||
|
||||
const sessionKey = authState.loginStatus;
|
||||
if (prevSessionKeyRef.current === sessionKey) return;
|
||||
prevSessionKeyRef.current = sessionKey;
|
||||
|
||||
if (authState.loginStatus === "notLoggedIn") {
|
||||
prevSessionKeyRef.current = sessionKey;
|
||||
chatDispatch({ type: "ChatLogout" });
|
||||
return;
|
||||
}
|
||||
|
||||
if (authState.loginStatus === "guest") {
|
||||
prevSessionKeyRef.current = sessionKey;
|
||||
chatDispatch({ type: "ChatGuestLogin" });
|
||||
return;
|
||||
}
|
||||
@@ -50,6 +51,7 @@ export function ChatAuthSync() {
|
||||
void (async () => {
|
||||
const tokenR = await AuthStorage.getInstance().getLoginToken();
|
||||
if (!cancelled && tokenR.success && tokenR.data) {
|
||||
prevSessionKeyRef.current = sessionKey;
|
||||
chatDispatch({
|
||||
type: "ChatUserLogin",
|
||||
token: tokenR.data,
|
||||
|
||||
Reference in New Issue
Block a user