fix and update
This commit is contained in:
@@ -565,9 +565,11 @@ let fedcmSyncTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let fedcmSyncInFlight = false;
|
||||
|
||||
/** Откладывает FedCM sync после OAuth/bootstrap, чтобы не конкурировать с consent/session. */
|
||||
export function scheduleFedcmSessionSync(accessToken?: string | null, delayMs = 1500) {
|
||||
export function scheduleFedcmSessionSync(accessToken?: string | null, delayMs = 8000) {
|
||||
if (typeof window === 'undefined') return;
|
||||
if (window.location.pathname.startsWith('/auth/oauth/authorize')) return;
|
||||
if (window.location.pathname.startsWith('/auth/login')) return;
|
||||
if (window.location.pathname.startsWith('/auth/register')) return;
|
||||
if (fedcmSyncTimer) {
|
||||
clearTimeout(fedcmSyncTimer);
|
||||
}
|
||||
@@ -747,17 +749,17 @@ export async function waitForStableGateway(stableProbes = GATEWAY_STABLE_PROBES)
|
||||
gatewayReadyAt = 0;
|
||||
|
||||
let streak = 0;
|
||||
for (let attempt = 0; attempt < 40 && streak < stableProbes; attempt += 1) {
|
||||
for (let attempt = 0; attempt < 24 && streak < stableProbes; attempt += 1) {
|
||||
if (await probeGatewayAlive()) {
|
||||
streak += 1;
|
||||
if (streak >= stableProbes) {
|
||||
markApiGatewayReady();
|
||||
return;
|
||||
}
|
||||
await sleep(400);
|
||||
await sleep(500);
|
||||
} else {
|
||||
streak = 0;
|
||||
await sleep(Math.min(500 + attempt * 220, 2200));
|
||||
await sleep(Math.min(700 + attempt * 250, 2500));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user