sessionStorage.js 503 B

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