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

Function loadImageGenConfig

apps/webuiapps/src/lib/imageGenClient.ts:49–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 * Falls back gracefully if the dev server API is unavailable.
48 */
49export async function loadImageGenConfig(): Promise<ImageGenConfig | null> {
50 // 1. Try local file via dev-server API
51 try {
52 const persisted = await loadPersistedConfig();
53 if (persisted?.imageGen) {
54 localStorage.setItem(CONFIG_KEY, JSON.stringify(persisted.imageGen));
55 return persisted.imageGen;
56 }
57 } catch {
58 // API not available — fall through
59 }
60
61 // 2. Fall back to localStorage
62 return loadImageGenConfigSync();
63}
64
65/** Synchronous read from localStorage cache. */
66export function loadImageGenConfigSync(): ImageGenConfig | null {

Callers 2

ChatPanelFunction · 0.90

Calls 2

loadPersistedConfigFunction · 0.90
loadImageGenConfigSyncFunction · 0.85

Tested by

no test coverage detected