Fix fleet stale-status flicker during polling

This commit is contained in:
2026-09-18 15:11:49 -04:00
parent f54cac8c50
commit 6d903adb31
6 changed files with 59 additions and 12 deletions
+2 -2
View File
@@ -1,4 +1,5 @@
import { parseServerName, zombieMapBySlug } from './map-aliases.js';
import { freshStatusTimestamp } from './server-freshness.js';
import type { ZombieGame } from './map-aliases.js';
import type { RoundTelemetry } from './telemetry.js';
import type { Health, RosterPlayer } from './ui/stores/servers.js';
@@ -40,8 +41,7 @@ export type FleetFilter = 'all' | 'occupied' | 'empty' | 'attention' | 'testing'
export type FleetSort = 'name' | 'players' | 'round' | 'duration';
export function freshServer(server: FleetServer, now: number): boolean {
const age = now - Date.parse(server.last_seen_at ?? '');
return server.health === 'online' && age >= 0 && age <= 30_000;
return server.health === 'online' && !server.last_error && freshStatusTimestamp(server.last_seen_at, now);
}
export function fleetIdentity(server: FleetServer) {