From cc6ce73fe417e8e5c2c3d8022ed9b109366b2ea0 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 8 Oct 2020 17:58:24 -0400 Subject: [PATCH] LocalReducer: fix empty case of localStorage rehydration --- pkg/interface/src/logic/reducers/local.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/logic/reducers/local.ts b/pkg/interface/src/logic/reducers/local.ts index 89a3fa822..0906730e9 100644 --- a/pkg/interface/src/logic/reducers/local.ts +++ b/pkg/interface/src/logic/reducers/local.ts @@ -8,7 +8,7 @@ type LocalState = Pick { rehydrate(state: S) { try { - const json = JSON.parse(localStorage.getItem('localReducer') || ''); + const json = JSON.parse(localStorage.getItem('localReducer') || '{}'); _.forIn(json, (value, key) => { state[key] = value; });