Incognito mode local storage issue (#33)
This commit is contained in:
parent
4027a6fe18
commit
91d18422de
|
@ -192,7 +192,9 @@ export default {
|
||||||
form_id: this.form.id
|
form_id: this.form.id
|
||||||
})
|
})
|
||||||
|
|
||||||
window.localStorage.removeItem(this.form.form_pending_submission_Key)
|
try {
|
||||||
|
window.localStorage.removeItem(this.form.form_pending_submission_key)
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
if (response.data.redirect && response.data.redirect_url) {
|
if (response.data.redirect && response.data.redirect_url) {
|
||||||
window.location.href = response.data.redirect_url
|
window.location.href = response.data.redirect_url
|
||||||
|
|
|
@ -222,7 +222,9 @@ export default {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler () {
|
handler () {
|
||||||
if(this.isPublicFormPage && this.form && this.dataFormValue){
|
if(this.isPublicFormPage && this.form && this.dataFormValue){
|
||||||
window.localStorage.setItem(this.form.form_pending_submission_Key, JSON.stringify(this.dataFormValue))
|
try {
|
||||||
|
window.localStorage.setItem(this.form.form_pending_submission_key, JSON.stringify(this.dataFormValue))
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -275,7 +277,12 @@ export default {
|
||||||
},
|
},
|
||||||
initForm () {
|
initForm () {
|
||||||
if (this.isPublicFormPage) {
|
if (this.isPublicFormPage) {
|
||||||
const pendingData = window.localStorage.getItem(this.form.form_pending_submission_Key)
|
let pendingData
|
||||||
|
try {
|
||||||
|
pendingData = window.localStorage.getItem(this.form.form_pending_submission_key)
|
||||||
|
} catch (e) {
|
||||||
|
pendingData = null
|
||||||
|
}
|
||||||
if(pendingData !== null && pendingData){
|
if(pendingData !== null && pendingData){
|
||||||
this.dataForm = new Form(JSON.parse(pendingData))
|
this.dataForm = new Form(JSON.parse(pendingData))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue