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

Function loadSiteConfig

public/js/sourceManager.js:5–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { t } from './i18n.js?v={{APP_QVER}}';
4
5async function loadSiteConfig() {
6 if (window.__FR_SITE_CFG__) return window.__FR_SITE_CFG__;
7 if (window.__FR_SITE_CFG_PROMISE) {
8 try { return await window.__FR_SITE_CFG_PROMISE; } catch (e) { return {}; }
9 }
10
11 try {
12 const res = await fetch(withBase('/api/public/siteConfig.php'), { credentials: 'include' });
13 const cfg = await res.json().catch(() => ({}));
14 window.__FR_SITE_CFG__ = cfg || {};
15 return window.__FR_SITE_CFG__;
16 } catch (e) {
17 return {};
18 }
19}
20
21function getSourcesConfig(cfg) {
22 if (!cfg || typeof cfg !== 'object') return {};

Callers 1

initSourceSelectorFunction · 0.70

Calls 1

withBaseFunction · 0.85

Tested by

no test coverage detected