mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
8841c8c874
[web] disable pdf caching feature in legacy Edge browser GitOrigin-RevId: f57ca3385337b5516e27a701646f2ed92325bf8d
14 lines
472 B
JavaScript
14 lines
472 B
JavaScript
import getMeta from '../../../utils/meta'
|
|
|
|
const hasTextEncoder = typeof TextEncoder !== 'undefined'
|
|
if (!hasTextEncoder) {
|
|
console.warn('TextEncoder is not available. Disabling pdf-caching.')
|
|
}
|
|
|
|
function isFlagEnabled(flag) {
|
|
if (!hasTextEncoder) return false
|
|
return getMeta('ol-splitTestVariants')?.[flag] === 'enabled'
|
|
}
|
|
|
|
export const enablePdfCaching = isFlagEnabled('pdf-caching-mode')
|
|
export const trackPdfDownloadEnabled = isFlagEnabled('track-pdf-download')
|