localStorage.js 485 B

12345678910111213141516171819
  1. import { debugConsole } from '@/utils/debugging'
  2. angular.module('localStorage', []).value('localStorage', localStorage)
  3. /*
  4. localStorage can throw browser exceptions, for example if it is full
  5. We don't use localStorage for anything critical, on in that case just
  6. fail gracefully.
  7. */
  8. function localStorage(...args) {
  9. try {
  10. return $.localStorage(...args)
  11. } catch (e) {
  12. debugConsole.error('localStorage exception', e)
  13. return null
  14. }
  15. }
  16. export default localStorage