Skip to content

Commit

Permalink
feat: code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Leach <[email protected]>
  • Loading branch information
jleach committed Jul 9, 2024
1 parent 6169569 commit 8b6eaa0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 1 addition & 7 deletions app/container-imp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ export class AppContainer implements Container {
let tours = initialState.tours
let onboarding = initialState.onboarding
let personCredOfferDissmissed = initialState.dismissPersonCredentialOffer
let environment = initialState.developer.environment
let remoteDebugging = initialState.developer.remoteDebugging
let { environment, remoteDebugging } = initialState.developer

await Promise.all([
loadLoginAttempt().then((data) => {
Expand Down Expand Up @@ -170,11 +169,6 @@ export class AppContainer implements Container {
`Remote logging enabled, last enabled at ${enabledAt}, session id: ${logger.sessionId}, ${sessionId}`
)
}
// logger.info(
// `Remote logging ${
// isOlderThanAutoDisableInterval ? 'expired' : 'enabled'
// }, last enabled at ${enabledAt}, session id: ${sessionId}`
// )
}

dispatch({ type: DispatchAction.STATE_DISPATCH, payload: [state] })
Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/Developer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const Settings: React.FC = () => {
setRemoteLoggingEnabled(remoteLoggingEnabled)

dispatch({
type: BCDispatchAction.ENABLE_REMOTE_DEBUGGING,
type: BCDispatchAction.REMOTE_DEBUGGING_STATUS_UPDATE,
payload: [{ enabled: remoteLoggingEnabled, expireAt: undefined }],
})

Expand All @@ -221,7 +221,7 @@ const Settings: React.FC = () => {
const remoteLoggingEnabled = true
DeviceEventEmitter.emit(RemoteLoggerEventTypes.ENABLE_REMOTE_LOGGING, remoteLoggingEnabled)
dispatch({
type: BCDispatchAction.ENABLE_REMOTE_DEBUGGING,
type: BCDispatchAction.REMOTE_DEBUGGING_STATUS_UPDATE,
payload: [{ enabledAt: new Date(), sessionId: logger.sessionId }],
})
setRemoteLoggingEnabled(remoteLoggingEnabled)
Expand Down
4 changes: 2 additions & 2 deletions app/src/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ enum DismissPersonCredentialOfferDispatchAction {
}

enum RemoteDebuggingDispatchAction {
ENABLE_REMOTE_DEBUGGING = 'remoteDebugging/enable',
REMOTE_DEBUGGING_STATUS_UPDATE = 'remoteDebugging/enable',
}

export type BCDispatchAction =
Expand Down Expand Up @@ -111,7 +111,7 @@ export const initialState: BCState = {

const bcReducer = (state: BCState, action: ReducerAction<BCDispatchAction>): BCState => {
switch (action.type) {
case RemoteDebuggingDispatchAction.ENABLE_REMOTE_DEBUGGING: {
case RemoteDebuggingDispatchAction.REMOTE_DEBUGGING_STATUS_UPDATE: {
const { enabledAt, sessionId } = (action.payload || []).pop()
const developer = { ...state.developer, remoteDebugging: { enabledAt, sessionId } }
const newState = { ...state, developer }
Expand Down

0 comments on commit 8b6eaa0

Please sign in to comment.