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

Persist contact modal form info

GitOrigin-RevId: d7bf656015694e36a717e89de0879233c43d63a3
This commit is contained in:
Simon Detheridge 2019-09-25 15:28:34 +01:00 committed by sharelatex
parent e5e28c7fb1
commit 89abb5b609
3 changed files with 20 additions and 15 deletions

View file

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

View file

@ -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) {
/*
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 {
return $.localStorage(...Array.from(args || []))
return $.localStorage(...args)
} catch (e) {
console.error('localStorage exception', e)
return null

View file

@ -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
}
})