fix(gateway): prevent session loading if gateway is not ready

This commit is contained in:
Haze
2026-04-18 15:04:10 +08:00
parent 006618e658
commit e1292073fc

View File

@@ -97,6 +97,9 @@ function maybeLoadSessions(
state: { loadSessions: () => Promise<void> },
force = false,
): void {
const { status } = useGatewayStore.getState();
if (status.gatewayReady === false) return;
const now = Date.now();
if (!force && now - lastLoadSessionsAt < LOAD_SESSIONS_MIN_INTERVAL_MS) return;
lastLoadSessionsAt = now;