Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 8db2477

Browse files
committed
Merge tag 'api-state-wallet-crash' into develop
Fixes wallet issue on update.
2 parents 553cf0a + 709cb48 commit 8db2477

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

app/js/store/reducers.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SanityReducer } from './sanity'
88
import SettingsReducer from '../account/store/settings/reducer'
99
import { AppsReducer } from './apps'
1010
import { DELETE_ACCOUNT } from '../account/store/account/types'
11+
import DEFAULT_API from '../account/store/settings/default'
1112

1213
export const UPDATE_STATE = 'UPDATE_STATE'
1314
export 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

4344
const 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

Comments
 (0)