()
| 376 | // =========================================================================== |
| 377 | |
| 378 | private loadCustomServersFromStorage(): void { |
| 379 | try { |
| 380 | const stored = localStorage.getItem(CUSTOM_SERVERS_KEY); |
| 381 | if (stored) { |
| 382 | this.customServers = JSON.parse(stored); |
| 383 | // Re-register persisted servers so fetchModels() queries them after a reload |
| 384 | for (const server of this.customServers) { |
| 385 | if (server.enabled && server.status === 'online') this.addServer(server.address); |
| 386 | } |
| 387 | } |
| 388 | } catch (error) { |
| 389 | console.error('Failed to load custom servers:', error); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | private saveCustomServersToStorage(): void { |
| 394 | localStorage.setItem(CUSTOM_SERVERS_KEY, JSON.stringify(this.customServers)); |
no test coverage detected