Changeset View
Changeset View
Standalone View
Standalone View
native/redux/redux-setup.js
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | import { | ||||
setStoreLoadedActionType, | setStoreLoadedActionType, | ||||
type Action, | type Action, | ||||
} from './action-types.js'; | } from './action-types.js'; | ||||
import { remoteReduxDevServerConfig } from './dev-tools.js'; | import { remoteReduxDevServerConfig } from './dev-tools.js'; | ||||
import { defaultDimensionsInfo } from './dimensions-updater.react.js'; | import { defaultDimensionsInfo } from './dimensions-updater.react.js'; | ||||
import { persistConfig, setPersistor } from './persist.js'; | import { persistConfig, setPersistor } from './persist.js'; | ||||
import { processDBStoreOperations } from './redux-utils.js'; | import { processDBStoreOperations } from './redux-utils.js'; | ||||
import type { AppState } from './state-types.js'; | import type { AppState } from './state-types.js'; | ||||
import reduceGlobalThemeInfo from './theme-reducer.js'; | |||||
import { defaultNavInfo } from '../navigation/default-state.js'; | import { defaultNavInfo } from '../navigation/default-state.js'; | ||||
import { getGlobalNavContext } from '../navigation/icky-global.js'; | import { getGlobalNavContext } from '../navigation/icky-global.js'; | ||||
import { activeMessageListSelector } from '../navigation/nav-selectors.js'; | import { activeMessageListSelector } from '../navigation/nav-selectors.js'; | ||||
import reactotron from '../reactotron.js'; | import reactotron from '../reactotron.js'; | ||||
import { defaultDeviceCameraInfo } from '../types/camera.js'; | import { defaultDeviceCameraInfo } from '../types/camera.js'; | ||||
import { defaultConnectivityInfo } from '../types/connectivity.js'; | import { defaultConnectivityInfo } from '../types/connectivity.js'; | ||||
import { defaultGlobalThemeInfo } from '../types/themes.js'; | import { defaultGlobalThemeInfo } from '../types/themes.js'; | ||||
import { isStaffRelease } from '../utils/staff-utils.js'; | import { isStaffRelease } from '../utils/staff-utils.js'; | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | ((action.type === logInActionTypes.success || | ||||
state, | state, | ||||
action.payload.currentUserInfo, | action.payload.currentUserInfo, | ||||
action.payload.logInActionSource, | action.payload.logInActionSource, | ||||
)) | )) | ||||
) { | ) { | ||||
return state; | return state; | ||||
} | } | ||||
state = { | |||||
...state, | |||||
globalThemeInfo: reduceGlobalThemeInfo(state.globalThemeInfo, action), | |||||
}; | |||||
if (action.type === setCustomServer) { | if (action.type === setCustomServer) { | ||||
return { | return { | ||||
...state, | ...state, | ||||
customServer: action.payload, | customServer: action.payload, | ||||
}; | }; | ||||
} else if (action.type === resetUserStateActionType) { | } else if (action.type === resetUserStateActionType) { | ||||
const cookie = | const cookie = | ||||
state.cookie && state.cookie.startsWith('anonymous=') | state.cookie && state.cookie.startsWith('anonymous=') | ||||
Show All 17 Lines | return { | ||||
}, | }, | ||||
}; | }; | ||||
} else if (action.type === updateConnectivityActiveType) { | } else if (action.type === updateConnectivityActiveType) { | ||||
return { | return { | ||||
...state, | ...state, | ||||
connectivity: action.payload, | connectivity: action.payload, | ||||
}; | }; | ||||
} else if (action.type === updateThemeInfoActionType) { | } else if (action.type === updateThemeInfoActionType) { | ||||
return { | // Handled above by reduceGlobalThemeInfo | ||||
...state, | return state; | ||||
globalThemeInfo: { | |||||
...state.globalThemeInfo, | |||||
...action.payload, | |||||
}, | |||||
}; | |||||
} else if (action.type === updateDeviceCameraInfoActionType) { | } else if (action.type === updateDeviceCameraInfoActionType) { | ||||
return { | return { | ||||
...state, | ...state, | ||||
deviceCameraInfo: { | deviceCameraInfo: { | ||||
...state.deviceCameraInfo, | ...state.deviceCameraInfo, | ||||
...action.payload, | ...action.payload, | ||||
}, | }, | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |