2026-06-29 15:27:35 +03:30
|
|
|
export function getConfigApp(key: string) {
|
|
|
|
|
const config = window.__APP_CONFIG__ ? window.__APP_CONFIG__.user : {}
|
|
|
|
|
|
|
|
|
|
if (config) {
|
|
|
|
|
return config[key]
|
|
|
|
|
}
|
|
|
|
|
return null
|
|
|
|
|
}
|
2026-07-28 21:02:44 +03:30
|
|
|
|
|
|
|
|
export function isBoursecuProject() {
|
|
|
|
|
const name = String(getConfigApp('name') || '').toLowerCase()
|
|
|
|
|
return name === 'boursecu' || name === 'boursemes'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function isTWA() {
|
|
|
|
|
if (typeof sessionStorage === 'undefined') return false
|
|
|
|
|
if (sessionStorage.getItem('appMode') === 'twa') return true
|
|
|
|
|
if (typeof document !== 'undefined' && document.referrer.startsWith('android-app://')) {
|
|
|
|
|
sessionStorage.setItem('appMode', 'twa')
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|