Skip to content

Commit

Permalink
[INJI-577]: fix clearing of UIN/VID after retreiving it from AID in V…
Browse files Browse the repository at this point in the history
…C download flow

Signed-off-by: Alka <[email protected]>
  • Loading branch information
Alka1703 committed Dec 12, 2023
1 parent 60f5831 commit 08878e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
12 changes: 2 additions & 10 deletions screens/Home/MyVcs/AddVcModalMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ export const AddVcModalMachine =
},
id: 'AddVcModal',
initial: 'acceptingIdInput',
on: {
INPUT_ID: {
actions: 'setId',
},
SELECT_ID_TYPE: {
actions: ['clearIdError', 'setIdType'],
},
},
states: {
acceptingIdInput: {
entry: ['setTransactionId', 'clearOtp'],
Expand Down Expand Up @@ -115,7 +107,7 @@ export const AddVcModalMachine =
},
],
SELECT_ID_TYPE: {
actions: ['clearIdError', 'setIdType', 'clearId'],
actions: ['clearIdError', 'setIdType'],
},
},
},
Expand Down Expand Up @@ -216,7 +208,7 @@ export const AddVcModalMachine =
cancelDownload: {
on: {
CANCEL: {
actions: ['resetIdInputRef', 'forwardToParent'],
actions: ['clearId', 'resetIdInputRef', 'forwardToParent'],
},
WAIT: {
target: 'acceptingOtpInput',
Expand Down
9 changes: 7 additions & 2 deletions screens/Home/MyVcs/OtpVerificationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
OtpVerificationModalProps,
useOtpVerificationModal,
} from './OtpVerificationModalController';
import {isIOS} from '../../../shared/constants';
import {GET_INDIVIDUAL_ID, isIOS} from '../../../shared/constants';

export const OtpVerificationModal: React.FC<
OtpVerificationModalProps
Expand Down Expand Up @@ -68,6 +68,11 @@ export const OtpVerificationModal: React.FC<
props.onInputDone(otp);
};

const handleRequestOTPCancel = () => {
GET_INDIVIDUAL_ID({id: '', idType: 'UIN'});
controller.CANCEL();
};

return (
<Modal
isVisible={props.isVisible}
Expand Down Expand Up @@ -157,7 +162,7 @@ export const OtpVerificationModal: React.FC<
testID="cancel"
type="clear"
title={t('confirmationDialog.cancel')}
onPress={controller.CANCEL}
onPress={handleRequestOTPCancel}
/>
</Column>
</MessageOverlay>
Expand Down

0 comments on commit 08878e2

Please sign in to comment.