diff --git a/components/ui/Error.tsx b/components/ui/Error.tsx index 7f5d81b4..2edc2fc6 100644 --- a/components/ui/Error.tsx +++ b/components/ui/Error.tsx @@ -19,7 +19,6 @@ export const Error: React.FC = props => { tryAgainButtonProps['width'] = Dimensions.get('screen').width * 0.54; tryAgainButtonProps['type'] = 'outline'; } - console.log('props.alignActionsOnEnd ', props.alignActionsOnEnd); const errorContent = () => { return ( diff --git a/machines/backupAndRestore/backupAndRestore.ts b/machines/backupAndRestore/backupAndRestoreSetup.ts similarity index 92% rename from machines/backupAndRestore/backupAndRestore.ts rename to machines/backupAndRestore/backupAndRestoreSetup.ts index 638f2fab..433c231d 100644 --- a/machines/backupAndRestore/backupAndRestore.ts +++ b/machines/backupAndRestore/backupAndRestoreSetup.ts @@ -27,13 +27,13 @@ const model = createModel( }, ); -export const BackupAndRestoreEvents = model.events; +export const BackupAndRestoreSetupEvents = model.events; -export const backupAndRestoreMachine = model.createMachine( +export const backupAndRestoreSetupMachine = model.createMachine( { predictableActionArguments: true, preserveActionOrder: true, - tsTypes: {} as import('./backupAndRestore.typegen').Typegen0, + tsTypes: {} as import('./backupAndRestoreSetup.typegen').Typegen0, schema: { context: model.initialContext, events: {} as EventFrom, @@ -178,9 +178,9 @@ export const backupAndRestoreMachine = model.createMachine( }, ); -export function createBackupMachine(serviceRefs: AppServices) { - return backupAndRestoreMachine.withContext({ - ...backupAndRestoreMachine.context, +export function createBackupAndRestoreSetupMachine(serviceRefs: AppServices) { + return backupAndRestoreSetupMachine.withContext({ + ...backupAndRestoreSetupMachine.context, }); } export function selectIsLoading(state: State) { @@ -211,4 +211,4 @@ export function selectIsSigningFailure(state: State) { return state.matches('signIn.error'); } -type State = StateFrom; +type State = StateFrom; diff --git a/machines/backupAndRestore/backupAndRestore.typegen.ts b/machines/backupAndRestore/backupAndRestoreSetup.typegen.ts similarity index 100% rename from machines/backupAndRestore/backupAndRestore.typegen.ts rename to machines/backupAndRestore/backupAndRestoreSetup.typegen.ts diff --git a/screens/backupAndRestore/BackupAndRestoreController.tsx b/screens/backupAndRestore/BackupAndRestoreSetupController.ts similarity index 57% rename from screens/backupAndRestore/BackupAndRestoreController.tsx rename to screens/backupAndRestore/BackupAndRestoreSetupController.ts index cd3ac5e2..2f18eeb9 100644 --- a/screens/backupAndRestore/BackupAndRestoreController.tsx +++ b/screens/backupAndRestore/BackupAndRestoreSetupController.ts @@ -2,8 +2,8 @@ import {useInterpret, useSelector} from '@xstate/react'; import {useRef} from 'react'; import { - BackupAndRestoreEvents, - backupAndRestoreMachine, + BackupAndRestoreSetupEvents, + backupAndRestoreSetupMachine, selectIsLoading, selectIsNetworkOff, selectIsSigningIn, @@ -11,18 +11,15 @@ import { selectIsSigningInSuccessful, selectProfileInfo, selectShowAccountSelectionConfirmation, -} from '../../machines/backupAndRestore/backupAndRestore'; -// import { logState } from '../../shared/commonUtil'; +} from '../../machines/backupAndRestore/backupAndRestoreSetup'; -export function useBackupAndRestore() { +export function useBackupAndRestoreSetup() { const machine = useRef( - backupAndRestoreMachine.withContext({ - ...backupAndRestoreMachine.context, + backupAndRestoreSetupMachine.withContext({ + ...backupAndRestoreSetupMachine.context, }), ); const service = useInterpret(machine.current); - //TODO: Remove backUp and restore machine log as it has sensitive info - // service.subscribe(logState); return { isLoading: useSelector(service, selectIsLoading), @@ -38,11 +35,11 @@ export function useBackupAndRestore() { isSigningInSuccessful: useSelector(service, selectIsSigningInSuccessful), BACKUP_AND_RESTORE: () => - service.send(BackupAndRestoreEvents.HANDLE_BACKUP_AND_RESTORE()), + service.send(BackupAndRestoreSetupEvents.HANDLE_BACKUP_AND_RESTORE()), PROCEED_ACCOUNT_SELECTION: () => - service.send(BackupAndRestoreEvents.PROCEED()), - GO_BACK: () => service.send(BackupAndRestoreEvents.GO_BACK()), - TRY_AGAIN: () => service.send(BackupAndRestoreEvents.TRY_AGAIN()), - DISMISS: () => service.send(BackupAndRestoreEvents.DISMISS()), + service.send(BackupAndRestoreSetupEvents.PROCEED()), + GO_BACK: () => service.send(BackupAndRestoreSetupEvents.GO_BACK()), + TRY_AGAIN: () => service.send(BackupAndRestoreSetupEvents.TRY_AGAIN()), + DISMISS: () => service.send(BackupAndRestoreSetupEvents.DISMISS()), }; }