[#3265] silent the localStorage quota error to prevent breaking the record form panel

This commit is contained in:
Gani Georgiev
2023-09-06 14:11:58 +03:00
parent abfe18bcce
commit ca136c5dc1
33 changed files with 52 additions and 40 deletions
@@ -141,7 +141,13 @@
}
function updateDraft(newSerializedData) {
window.localStorage.setItem(draftKey(), newSerializedData);
try {
window.localStorage.setItem(draftKey(), newSerializedData);
} catch (e) {
// ignore local storage errors in case the serialized data
// exceed the browser localStorage single value quota
console.warn("updateDraft failure:", e)
}
}
function restoreDraft() {
@@ -484,6 +490,7 @@
</svelte:fragment>
<div class="tabs-content">
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<form
id={formId}
class="tab-item"