2022-07-20 04:32:05 -04:00
|
|
|
import getMeta from '../../../utils/meta'
|
|
|
|
|
2022-07-28 05:21:46 -04:00
|
|
|
const hasTextEncoder = typeof TextEncoder !== 'undefined'
|
|
|
|
if (!hasTextEncoder) {
|
|
|
|
console.warn('TextEncoder is not available. Disabling pdf-caching.')
|
|
|
|
}
|
|
|
|
|
2022-07-20 04:32:05 -04:00
|
|
|
function isFlagEnabled(flag) {
|
2022-07-28 05:21:46 -04:00
|
|
|
if (!hasTextEncoder) return false
|
2022-07-20 04:32:05 -04:00
|
|
|
return getMeta('ol-splitTestVariants')?.[flag] === 'enabled'
|
|
|
|
}
|
|
|
|
|
|
|
|
export const enablePdfCaching = isFlagEnabled('pdf-caching-mode')
|
|
|
|
export const trackPdfDownloadEnabled = isFlagEnabled('track-pdf-download')
|