aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-30 07:40:57 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-30 07:40:57 +0800
commitfb6476224ff0537e179705c2ae0895672a23a67b (patch)
tree467ed6d45d994a8db1a90dbd50868785c02f8d30 /ui
parente85418b11ad14bf6f0cc3fdbcdbb5669330c4778 (diff)
downloadtangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar.gz
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar.bz2
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar.lz
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar.xz
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.tar.zst
tangerine-wallet-browser-fb6476224ff0537e179705c2ae0895672a23a67b.zip
Add tolerance for failed form persisting
Diffstat (limited to 'ui')
-rw-r--r--ui/lib/persistent-form.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/lib/persistent-form.js b/ui/lib/persistent-form.js
index 2fd7600a2..c2bf99360 100644
--- a/ui/lib/persistent-form.js
+++ b/ui/lib/persistent-form.js
@@ -14,6 +14,9 @@ inherits(PersistentForm, Component)
PersistentForm.prototype.componentDidMount = function () {
const fields = document.querySelectorAll('[data-persistent-formid]')
const store = this.getPersistentStore()
+ if (!fields) {
+ return
+ }
fields.forEach((field) => {
const key = field.getAttribute('data-persistent-formid')
const cached = store[key]
@@ -50,8 +53,12 @@ PersistentForm.prototype.persistentFieldDidUpdate = function (event) {
PersistentForm.prototype.componentWillUnmount = function () {
const fields = document.querySelectorAll('[data-persistent-formid]')
+ if (!fields) {
+ return
+ }
fields.forEach((field) => {
field.removeEventListener(eventName, this.persistentFieldDidUpdate.bind(this))
})
this.setPersistentStore({})
}
+