mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-07 20:53:54 -05:00
[INJIMOB-2576] fix app lockout issue when app exited in passcode screen. (#1749)
Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
|
||||
// This file was automatically generated. Edits will be overwritten
|
||||
|
||||
export interface Typegen0 {
|
||||
'@@xstate/typegen': true;
|
||||
internalEvents: {
|
||||
"": { type: "" };
|
||||
"done.invoke.auth.authorized:invocation[0]": { type: "done.invoke.auth.authorized:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
|
||||
"done.invoke.auth.introSlider:invocation[0]": { type: "done.invoke.auth.introSlider:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
|
||||
"xstate.init": { type: "xstate.init" };
|
||||
};
|
||||
invokeSrcNameMap: {
|
||||
"downloadFaceSdkModel": "done.invoke.auth.authorized:invocation[0]";
|
||||
"generatePasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
|
||||
};
|
||||
missingImplementations: {
|
||||
actions: never;
|
||||
delays: never;
|
||||
guards: never;
|
||||
services: never;
|
||||
};
|
||||
eventsCausingActions: {
|
||||
"requestStoredContext": "xstate.init";
|
||||
"setBiometrics": "SETUP_BIOMETRICS";
|
||||
"setContext": "STORE_RESPONSE";
|
||||
"setInitialDownloadDone": "INITIAL_DOWNLOAD_DONE";
|
||||
"setIsToggleFromSettings": "CHANGE_METHOD";
|
||||
"setLanguage": "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
|
||||
"setOnboardingDone": "ONBOARDING_DONE";
|
||||
"setPasscode": "SETUP_PASSCODE";
|
||||
"setPasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
|
||||
"setTourGuide": "SET_TOUR_GUIDE";
|
||||
"storeContext": "INITIAL_DOWNLOAD_DONE" | "ONBOARDING_DONE" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE" | "STORE_RESPONSE" | "done.invoke.auth.authorized:invocation[0]" | "done.invoke.auth.introSlider:invocation[0]";
|
||||
};
|
||||
eventsCausingDelays: {
|
||||
|
||||
};
|
||||
eventsCausingGuards: {
|
||||
"hasBiometricSet": "";
|
||||
"hasData": "STORE_RESPONSE";
|
||||
"hasLanguageset": "";
|
||||
"hasPasscodeSet": "";
|
||||
};
|
||||
eventsCausingServices: {
|
||||
"downloadFaceSdkModel": "LOGIN" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
|
||||
"generatePasscodeSalt": "SELECT";
|
||||
};
|
||||
matchesStates: "authorized" | "checkingAuth" | "init" | "introSlider" | "languagesetup" | "savingDefaults" | "settingUp" | "unauthorized";
|
||||
tags: never;
|
||||
}
|
||||
|
||||
@@ -1,73 +1,56 @@
|
||||
// This file was automatically generated. Edits will be overwritten
|
||||
|
||||
export interface Typegen0 {
|
||||
'@@xstate/typegen': true;
|
||||
internalEvents: {
|
||||
'done.invoke.settings.resetInjiProps:invocation[0]': {
|
||||
type: 'done.invoke.settings.resetInjiProps:invocation[0]';
|
||||
data: unknown;
|
||||
__tip: 'See the XState TS docs to learn how to strongly type this.';
|
||||
};
|
||||
'error.platform.settings.resetInjiProps:invocation[0]': {
|
||||
type: 'error.platform.settings.resetInjiProps:invocation[0]';
|
||||
data: unknown;
|
||||
};
|
||||
'xstate.init': {type: 'xstate.init'};
|
||||
};
|
||||
invokeSrcNameMap: {
|
||||
resetInjiProps: 'done.invoke.settings.resetInjiProps:invocation[0]';
|
||||
};
|
||||
missingImplementations: {
|
||||
actions: 'setKeyManagementExplored';
|
||||
delays: never;
|
||||
guards: never;
|
||||
services: never;
|
||||
};
|
||||
eventsCausingActions: {
|
||||
requestStoredContext: 'BIOMETRIC_CANCELLED' | 'xstate.init';
|
||||
resetCredentialRegistryResponse: 'CANCEL' | 'UPDATE_HOST';
|
||||
resetIsBiometricToggled: 'DISMISS';
|
||||
resetKeyOrderingResponse: 'RESET_KEY_ORDER_RESPONSE';
|
||||
setContext: 'STORE_RESPONSE';
|
||||
setIsBiometricToggled: 'TOGGLE_BIOMETRIC_UNLOCK';
|
||||
setKeyManagementExplored: 'SET_KEY_MANAGEMENT_EXPLORED';
|
||||
setKeyManagementTourGuideExplored: 'SET_KEY_MANAGEMENT_TOUR_GUIDE_EXPLORED';
|
||||
setKeyOrderingResponse: 'SET_KEY_ORDER_RESPONSE';
|
||||
storeContext:
|
||||
| 'ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS'
|
||||
| 'SET_KEY_MANAGEMENT_EXPLORED'
|
||||
| 'SHOWN_ACCOUNT_SELECTION_CONFIRMATION'
|
||||
| 'STORE_RESPONSE'
|
||||
| 'TOGGLE_BIOMETRIC_UNLOCK'
|
||||
| 'UPDATE_HOST'
|
||||
| 'UPDATE_NAME'
|
||||
| 'UPDATE_VC_LABEL'
|
||||
| 'done.invoke.settings.resetInjiProps:invocation[0]';
|
||||
toggleBiometricUnlock: 'TOGGLE_BIOMETRIC_UNLOCK';
|
||||
updateCredentialRegistry: 'done.invoke.settings.resetInjiProps:invocation[0]';
|
||||
updateCredentialRegistryResponse: 'error.platform.settings.resetInjiProps:invocation[0]';
|
||||
updateCredentialRegistrySuccess: 'done.invoke.settings.resetInjiProps:invocation[0]';
|
||||
updateDefaults: 'STORE_RESPONSE';
|
||||
updateEsignetHostUrl: 'UPDATE_HOST';
|
||||
updateIsAccountSelectionConfirmationShown: 'SHOWN_ACCOUNT_SELECTION_CONFIRMATION';
|
||||
updateName: 'UPDATE_NAME';
|
||||
updatePartialDefaults: 'STORE_RESPONSE';
|
||||
updateUserShownWithHardwareKeystoreNotExists: 'ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS';
|
||||
updateVcLabel: 'UPDATE_VC_LABEL';
|
||||
};
|
||||
eventsCausingDelays: {};
|
||||
eventsCausingGuards: {
|
||||
hasData: 'STORE_RESPONSE';
|
||||
hasPartialData: 'STORE_RESPONSE';
|
||||
};
|
||||
eventsCausingServices: {
|
||||
resetInjiProps: 'UPDATE_HOST';
|
||||
};
|
||||
matchesStates:
|
||||
| 'idle'
|
||||
| 'init'
|
||||
| 'resetInjiProps'
|
||||
| 'showInjiTourGuide'
|
||||
| 'storingDefaults';
|
||||
tags: never;
|
||||
}
|
||||
// This file was automatically generated. Edits will be overwritten
|
||||
|
||||
export interface Typegen0 {
|
||||
'@@xstate/typegen': true;
|
||||
internalEvents: {
|
||||
"done.invoke.settings.resetInjiProps:invocation[0]": { type: "done.invoke.settings.resetInjiProps:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
|
||||
"error.platform.settings.resetInjiProps:invocation[0]": { type: "error.platform.settings.resetInjiProps:invocation[0]"; data: unknown };
|
||||
"xstate.init": { type: "xstate.init" };
|
||||
};
|
||||
invokeSrcNameMap: {
|
||||
"resetInjiProps": "done.invoke.settings.resetInjiProps:invocation[0]";
|
||||
};
|
||||
missingImplementations: {
|
||||
actions: "setKeyManagementExplored";
|
||||
delays: never;
|
||||
guards: never;
|
||||
services: never;
|
||||
};
|
||||
eventsCausingActions: {
|
||||
"requestStoredContext": "BIOMETRIC_CANCELLED" | "xstate.init";
|
||||
"resetCredentialRegistryResponse": "CANCEL" | "UPDATE_HOST";
|
||||
"resetIsBiometricToggled": "DISMISS";
|
||||
"resetKeyOrderingResponse": "RESET_KEY_ORDER_RESPONSE";
|
||||
"setContext": "STORE_RESPONSE";
|
||||
"setIsBiometricToggled": "TOGGLE_BIOMETRIC_UNLOCK";
|
||||
"setKeyManagementExplored": "SET_KEY_MANAGEMENT_EXPLORED";
|
||||
"setKeyManagementTourGuideExplored": "SET_KEY_MANAGEMENT_TOUR_GUIDE_EXPLORED";
|
||||
"setKeyOrderingResponse": "SET_KEY_ORDER_RESPONSE";
|
||||
"storeContext": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS" | "SET_KEY_MANAGEMENT_EXPLORED" | "SHOWN_ACCOUNT_SELECTION_CONFIRMATION" | "STORE_RESPONSE" | "TOGGLE_BIOMETRIC_UNLOCK" | "UPDATE_HOST" | "UPDATE_NAME" | "UPDATE_VC_LABEL" | "done.invoke.settings.resetInjiProps:invocation[0]";
|
||||
"toggleBiometricUnlock": "TOGGLE_BIOMETRIC_UNLOCK";
|
||||
"updateCredentialRegistry": "done.invoke.settings.resetInjiProps:invocation[0]";
|
||||
"updateCredentialRegistryResponse": "error.platform.settings.resetInjiProps:invocation[0]";
|
||||
"updateCredentialRegistrySuccess": "done.invoke.settings.resetInjiProps:invocation[0]";
|
||||
"updateDefaults": "STORE_RESPONSE";
|
||||
"updateEsignetHostUrl": "UPDATE_HOST";
|
||||
"updateIsAccountSelectionConfirmationShown": "SHOWN_ACCOUNT_SELECTION_CONFIRMATION";
|
||||
"updateName": "UPDATE_NAME";
|
||||
"updatePartialDefaults": "STORE_RESPONSE";
|
||||
"updateUserShownWithHardwareKeystoreNotExists": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS";
|
||||
"updateVcLabel": "UPDATE_VC_LABEL";
|
||||
};
|
||||
eventsCausingDelays: {
|
||||
|
||||
};
|
||||
eventsCausingGuards: {
|
||||
"hasData": "STORE_RESPONSE";
|
||||
"hasPartialData": "STORE_RESPONSE";
|
||||
};
|
||||
eventsCausingServices: {
|
||||
"resetInjiProps": "UPDATE_HOST";
|
||||
};
|
||||
matchesStates: "idle" | "init" | "resetInjiProps" | "showInjiTourGuide" | "storingDefaults";
|
||||
tags: never;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,12 @@ import {
|
||||
sendEndEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
import { SettingsEvents } from '../machines/settings';
|
||||
|
||||
export function usePasscodeScreen(props: PasscodeRouteProps) {
|
||||
const {appService} = useContext(GlobalContext);
|
||||
const authService = appService.children.get('auth');
|
||||
|
||||
const settingsService = appService.children.get('settings');
|
||||
const isAuthorized = useSelector(authService, selectAuthorized);
|
||||
const isPasscodeSet = () => !!passcode;
|
||||
const [passcode, setPasscode] = useState('');
|
||||
@@ -56,6 +57,7 @@ export function usePasscodeScreen(props: PasscodeRouteProps) {
|
||||
|
||||
SETUP_PASSCODE: () => {
|
||||
authService.send(AuthEvents.SETUP_PASSCODE(passcode));
|
||||
settingsService?.send(SettingsEvents.TOGGLE_BIOMETRIC_UNLOCK(false,true))
|
||||
},
|
||||
|
||||
storedSalt: useSelector(authService, selectPasscodeSalt),
|
||||
|
||||
@@ -167,7 +167,6 @@ export function useSettingsScreen(props: RootRouteProps & RequestRouteProps) {
|
||||
|
||||
CHANGE_UNLOCK_METHOD: (val: boolean) => {
|
||||
authService.send(AuthEvents.CHANGE_METHOD(true));
|
||||
settingsService.send(SettingsEvents.TOGGLE_BIOMETRIC_UNLOCK(val, true));
|
||||
props.navigation.navigate('Passcode', {setup: true});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user