From 8b6eaa081b2314b4a377d0e574d359580a3485ab Mon Sep 17 00:00:00 2001 From: "Jason C. Leach" Date: Tue, 9 Jul 2024 12:14:07 -0700 Subject: [PATCH] feat: code cleanup Signed-off-by: Jason C. Leach --- app/container-imp.ts | 8 +------- app/src/screens/Developer.tsx | 4 ++-- app/src/store.tsx | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/container-imp.ts b/app/container-imp.ts index a54d05ae7..3350b3655 100644 --- a/app/container-imp.ts +++ b/app/container-imp.ts @@ -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) => { @@ -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] }) diff --git a/app/src/screens/Developer.tsx b/app/src/screens/Developer.tsx index ef9641b3d..38c72f466 100644 --- a/app/src/screens/Developer.tsx +++ b/app/src/screens/Developer.tsx @@ -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 }], }) @@ -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) diff --git a/app/src/store.tsx b/app/src/store.tsx index b37344dd2..8bb021024 100644 --- a/app/src/store.tsx +++ b/app/src/store.tsx @@ -41,7 +41,7 @@ enum DismissPersonCredentialOfferDispatchAction { } enum RemoteDebuggingDispatchAction { - ENABLE_REMOTE_DEBUGGING = 'remoteDebugging/enable', + REMOTE_DEBUGGING_STATUS_UPDATE = 'remoteDebugging/enable', } export type BCDispatchAction = @@ -111,7 +111,7 @@ export const initialState: BCState = { const bcReducer = (state: BCState, action: ReducerAction): 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 }