MCPcopy Create free account
hub / github.com/Roy3838/Observer / loadCustomServersFromStorage

Method loadCustomServersFromStorage

app/src/utils/ModelManager.ts:378–391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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));

Callers 1

constructorMethod · 0.95

Calls 2

addServerMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected