mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
metamask - never persist if state is missing data
This commit is contained in:
parent
0685381fdc
commit
6f4dbd6d4a
@ -162,9 +162,9 @@ function setupController (initState, initLangCode) {
|
|||||||
asStream(controller.store),
|
asStream(controller.store),
|
||||||
debounce(1000),
|
debounce(1000),
|
||||||
storeTransform(versionifyData),
|
storeTransform(versionifyData),
|
||||||
storeTransform(syncDataWithExtension),
|
storeTransform(persistData),
|
||||||
(error) => {
|
(error) => {
|
||||||
log.error('pump hit error', error)
|
log.error('MetaMask - Persistence pipeline failed', error)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -173,7 +173,10 @@ function setupController (initState, initLangCode) {
|
|||||||
return versionedData
|
return versionedData
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncDataWithExtension(state) {
|
function persistData(state) {
|
||||||
|
if (!state.data) {
|
||||||
|
throw new Error('MetaMask - updated state is missing data', state)
|
||||||
|
}
|
||||||
if (localStore.isSupported) {
|
if (localStore.isSupported) {
|
||||||
localStore.set(state)
|
localStore.set(state)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user