File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
containers/domain-autocomplete Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 2222import { migrateRecentDomains } from './helpers' ;
2323
2424const reducer = state => ( {
25- ...state . domainAutocomplete ,
26- visitedDomainList : migrateRecentDomains (
27- state . domainAutocomplete . visitedDomainList
28- ) ,
25+ ...state ,
26+ visitedDomainList : migrateRecentDomains ( state . visitedDomainList ) ,
2927} ) ;
3028
3129export default reducer ;
Original file line number Diff line number Diff line change @@ -85,10 +85,18 @@ const getStoreConfig = ({ router, state }) => {
8585 const initialState = getDefaultState ( state ) ;
8686
8787 const vuexLocal = new VuexPersistence ( {
88- reducer : state => ( {
89- ...state ,
90- domainAutocomplete : domainAutocompleteReducer ( state ) ,
91- } ) ,
88+ restoreState : key => {
89+ const state = JSON . tryParse ( localStorage . getItem ( key ) ) ;
90+
91+ if ( ! state ) {
92+ return ;
93+ }
94+
95+ return {
96+ ...state ,
97+ domainAutocomplete : domainAutocompleteReducer ( state . domainAutocomplete ) ,
98+ } ;
99+ } ,
92100 storage : window . localStorage ,
93101 } ) ;
94102
You can’t perform that action at this time.
0 commit comments