MCPcopy Create free account
hub / github.com/error311/FileRise / initAiChat

Function initAiChat

public/js/aiChat.js:1492–1508  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1490}
1491
1492export async function initAiChat() {
1493 if (initialized) return;
1494 if (window.__FR_IS_PRO !== true) return;
1495 initialized = true;
1496
1497 try {
1498 const cfg = await apiGet('/api/pro/ai/config/public.php');
1499 const settings = (cfg && cfg.settings && typeof cfg.settings === 'object') ? cfg.settings : {};
1500 if (!settings.chatEnabled) {
1501 return;
1502 }
1503
1504 createChatUi(cfg);
1505 } catch (e) {
1506 // Non-Pro or disabled instances are expected to fail this request.
1507 }
1508}

Callers

nothing calls this directly

Calls 2

createChatUiFunction · 0.85
apiGetFunction · 0.70

Tested by

no test coverage detected