class KeepLoginAlive { // Ping the server every 5 minutes pingInterval: number = 5 * 60 * 1000; interval: number | null = null; start(): void { this.interval = window.setInterval(this.ping, this.pingInterval); } stop(): void { if (this.interval) { clearInterval(this.interval); } } async ping(): Promise { const response = await fetch('/api/status/ping'); if (!response.ok) { throw new Error(`Server responded with ${response.status}: ${response.statusText}`); } return; } } export default new KeepLoginAlive();