@@ -8,6 +8,7 @@ import { SanityReducer } from './sanity'
88import SettingsReducer from '../account/store/settings/reducer'
99import { AppsReducer } from './apps'
1010import { DELETE_ACCOUNT } from '../account/store/account/types'
11+ import DEFAULT_API from '../account/store/settings/default'
1112
1213export const UPDATE_STATE = 'UPDATE_STATE'
1314export const MIGRATE_API_ENDPOINTS = 'MIGRATE_API_ENDPOINTS'
@@ -38,7 +39,7 @@ export function initializeStateVersion() {
3839 * and other state is regenerated.
3940 * @type {number }
4041 */
41- export const CURRENT_VERSION : number = 14
42+ export const CURRENT_VERSION : number = 15
4243
4344const AppReducer = combineReducers ( {
4445 account : AccountReducer ,
@@ -54,9 +55,18 @@ function reducer(state: any, action: any) {
5455 let newState : any = Object . assign ( { } , state )
5556 if ( action . type === UPDATE_STATE ) {
5657 const initialState = AppReducer ( undefined , { } )
58+
59+ const preservedApiSettingsState = {
60+ gaiaHubUrl : state . settings . api . gaiaHubUrl ,
61+ distinctEventId : state . settings . api . distinctEventId ,
62+ hasDisabledEventTracking : state . settings . api . hasDisabledEventTracking
63+ }
64+
65+ const newApiSettingsState = Object . assign ( DEFAULT_API , preservedApiSettingsState )
66+
5767 newState = Object . assign ( { } , initialState , {
5868 settings : {
59- api : Object . assign ( { } , state . settings . api )
69+ api : newApiSettingsState
6070 } ,
6171 account : Object . assign ( { } , initialState . account , {
6272 promptedForEmail : state . account . promptedForEmail ,
0 commit comments