Explorar el Código

Merge pull request #2160 from overleaf/pr-persist-contact-modal-details

Persist contact modal form info

GitOrigin-RevId: d7bf656015694e36a717e89de0879233c43d63a3
Simon Detheridge hace 7 años
padre
commit
89abb5b609

+ 2 - 0
services/web/public/src/base.js

@@ -22,6 +22,7 @@ define([
   'modules/recursionHelper',
   'modules/recursionHelper',
   'modules/errorCatcher',
   'modules/errorCatcher',
   'modules/localStorage',
   'modules/localStorage',
+  'modules/sessionStorage',
   'utils/underscore'
   'utils/underscore'
 ], function() {
 ], function() {
   const App = angular
   const App = angular
@@ -35,6 +36,7 @@ define([
       'ipCookie',
       'ipCookie',
       'ErrorCatcher',
       'ErrorCatcher',
       'localStorage',
       'localStorage',
+      'sessionStorage',
       'ngTagsInput',
       'ngTagsInput',
       'ui.select'
       'ui.select'
     ])
     ])

+ 5 - 15
services/web/public/src/modules/localStorage.js

@@ -1,21 +1,11 @@
-/* eslint-disable
-    no-undef,
-*/
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS101: Remove unnecessary use of Array.from
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 angular.module('localStorage', []).value('localStorage', function(...args) {
 angular.module('localStorage', []).value('localStorage', function(...args) {
   /*
   /*
-		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.
-		*/
+    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.
+  */
   try {
   try {
-    return $.localStorage(...Array.from(args || []))
+    return $.localStorage(...args)
   } catch (e) {
   } catch (e) {
     console.error('localStorage exception', e)
     console.error('localStorage exception', e)
     return null
     return null

+ 13 - 0
services/web/public/src/modules/sessionStorage.js

@@ -0,0 +1,13 @@
+angular.module('sessionStorage', []).value('sessionStorage', function(...args) {
+  /*
+    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.
+  */
+  try {
+    return $.sessionStorage(...args)
+  } catch (e) {
+    console.error('sessionStorage exception', e)
+    return null
+  }
+})