overleaf/services/web/frontend/js/modules/localStorage.js
Paulo Jorge Reis 0e9771ac09 Merge pull request #3007 from overleaf/pr-file-outline-extras
File outline extras

GitOrigin-RevId: c35c4f35dce280c9f44c02b567df9734943d0cb0
2020-07-17 02:06:42 +00:00

17 lines
430 B
JavaScript

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