()
| 3 | import { t } from './i18n.js?v={{APP_QVER}}'; |
| 4 | |
| 5 | async 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 | |
| 21 | function getSourcesConfig(cfg) { |
| 22 | if (!cfg || typeof cfg !== 'object') return {}; |
no test coverage detected