MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / loadPersistedConfig

Function loadPersistedConfig

apps/webuiapps/src/lib/configPersistence.ts:29–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 * Returns null if the API is unavailable or the file doesn't exist.
28 */
29export async function loadPersistedConfig(): Promise<PersistedConfig | null> {
30 try {
31 const res = await fetch(CONFIG_API);
32 if (res.ok) {
33 const data: unknown = await res.json();
34 if (isLegacyConfig(data)) {
35 return { llm: data };
36 }
37 if (typeof data === 'object' && data !== null && 'llm' in data) {
38 return data as PersistedConfig;
39 }
40 }
41 } catch {
42 // API not available (production / network error)
43 }
44 return null;
45}
46
47/**
48 * Save the full config to ~/.openroom/config.json via the dev-server API.

Callers 3

loadConfigFunction · 0.90
loadImageGenConfigFunction · 0.90

Calls 1

isLegacyConfigFunction · 0.85

Tested by

no test coverage detected