overleaf/services/web/frontend/js/modules/sessionStorage.js
Alexandre Bourdin c634f51eee Merge pull request #4116 from overleaf/ab-paywall-prompt-events
Add paywall prompt events

GitOrigin-RevId: 6b1b3b384590f14828f37210b2e14047e2ee33d6
2021-06-11 02:05:54 +00:00

17 lines
448 B
JavaScript

angular.module('sessionStorage', []).value('sessionStorage', sessionStorage)
/*
sessionStorage can throw browser exceptions, for example if it is full
We don't use sessionStorage for anything critical, on in that case just
fail gracefully.
*/
function sessionStorage(...args) {
try {
return $.sessionStorage(...args)
} catch (e) {
console.error('sessionStorage exception', e)
return null
}
}
export default sessionStorage