fix: 优化嵌入登录等待态并修复大厅与订单筛选交互

This commit is contained in:
2026-06-08 17:42:04 +08:00
parent 36adf8699d
commit 2ddba8462e
13 changed files with 71 additions and 75 deletions

View File

@@ -109,6 +109,12 @@ export function EntryGate() {
const { bearerToken, setBearerToken, setProfile, setCurrencies, clearBearerToken } =
usePlayerSessionStore();
const waitingForEmbeddedToken =
!sessionExpired &&
typeof window !== "undefined" &&
isInIframe() &&
!tokenFromUrl &&
!(bearerToken ?? "").trim();
const [phase, setPhase] = useState<Phase>(sessionExpired ? "failed" : "loading");
const [failureDetails, setFailureDetails] = useState<FailureRow[]>(() =>
@@ -273,19 +279,12 @@ export function EntryGate() {
}, [sessionExpired, clearBearerToken]);
useEffect(() => {
if (sessionExpired) return;
const embedded = typeof window !== "undefined" && isInIframe() && !tokenFromUrl;
if (embedded && !effectiveToken) {
setPhase("loading");
return;
}
if (sessionExpired || waitingForEmbeddedToken) return;
const tmr = window.setTimeout(() => {
void doEntry();
}, 300);
return () => window.clearTimeout(tmr);
}, [doEntry, sessionExpired, effectiveToken, tokenFromUrl]);
}, [doEntry, sessionExpired, waitingForEmbeddedToken]);
useEffect(() => {
if (sessionExpired) return;
@@ -320,7 +319,7 @@ export function EntryGate() {
</div>
<div className="flex flex-1 flex-col px-3 py-5">
{phase === "loading" ? (
{phase === "loading" || waitingForEmbeddedToken ? (
<div className="mx-auto w-full max-w-md">
<div className="mb-6 flex items-center gap-2">
<div className="flex size-8 items-center justify-center rounded bg-red-600 text-white">

View File

@@ -24,10 +24,6 @@ export function NotificationsScreen() {
return (
<PlayerPanel title={t("notifications.title")} backHref="/hall">
<div className="space-y-3">
<p className="rounded-xl border border-amber-200 bg-amber-50/90 px-3 py-2.5 text-xs leading-relaxed text-amber-900">
{t("notifications.subtitle")}
</p>
<div className="flex items-center justify-between rounded-xl border border-[#dce7f7] bg-[#f8fbff] px-3 py-2.5">
<p className="text-sm font-semibold text-[#0b3f96]">
{t("notifications.unreadCount", { count: unreadCount })}