aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-04-07 03:08:51 +0800
committerkumavis <aaron@kumavis.me>2018-04-07 03:09:26 +0800
commit6f4dbd6d4a27888ccff88d336ae4340cb69c90e7 (patch)
tree34a9337bd80f3488eb8a21e36c1731944e63c16f
parent0685381fdcd3ab8cebc76bf73e9678deaf5d15f8 (diff)
downloadtangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar.gz
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar.bz2
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar.lz
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar.xz
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.tar.zst
tangerine-wallet-browser-6f4dbd6d4a27888ccff88d336ae4340cb69c90e7.zip
metamask - never persist if state is missing data
-rw-r--r--app/scripts/background.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index a4d95289b..837fd7133 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -162,9 +162,9 @@ function setupController (initState, initLangCode) {
asStream(controller.store),
debounce(1000),
storeTransform(versionifyData),
- storeTransform(syncDataWithExtension),
+ storeTransform(persistData),
(error) => {
- log.error('pump hit error', error)
+ log.error('MetaMask - Persistence pipeline failed', error)
}
)
@@ -173,7 +173,10 @@ function setupController (initState, initLangCode) {
return versionedData
}
- function syncDataWithExtension(state) {
+ function persistData(state) {
+ if (!state.data) {
+ throw new Error('MetaMask - updated state is missing data', state)
+ }
if (localStore.isSupported) {
localStore.set(state)
.catch((err) => {