Skip to content

Commit

Permalink
feat(INJI-299): refactor confirmation dialog flow
Browse files Browse the repository at this point in the history
Signed-off-by: Pooja Babusingh <[email protected]>
  • Loading branch information
PoojaBabusingh committed Oct 19, 2023
1 parent 50583ef commit 19f0405
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion screens/Home/MyVcs/AddVcModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const AddVcModal: React.FC<AddVcModalProps> = props => {

<OtpVerificationModal
isVisible={controller.isAcceptingOtpInput}
onDismiss={controller.CANCEL_DOWNLOAD}
onDismiss={controller.DISMISS}
onInputDone={controller.INPUT_OTP}
error={controller.otpError}
resend={controller.RESEND_OTP}
Expand Down
2 changes: 0 additions & 2 deletions screens/Home/MyVcs/AddVcModalController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export function useAddVcModal({service}: AddVcModalProps) {

DISMISS: () => service.send(AddVcModalEvents.DISMISS()),

CANCEL_DOWNLOAD: () => service.send(AddVcModalEvents.CANCEL_DOWNLOAD()),

WAIT: () => service.send(AddVcModalEvents.WAIT()),

CANCEL: () => service.send(AddVcModalEvents.CANCEL()),
Expand Down
9 changes: 1 addition & 8 deletions screens/Home/MyVcs/AddVcModalMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const model = createModel(
DISMISS: () => ({}),
CANCEL: () => ({}),
WAIT: () => ({}),
CANCEL_DOWNLOAD: () => ({}),
SELECT_ID_TYPE: (idType: VcIdType) => ({idType}),
},
},
Expand Down Expand Up @@ -174,13 +173,8 @@ export const AddVcModalMachine =
actions: 'setOtp',
target: 'requestingCredential',
},
CANCEL_DOWNLOAD: {
actions: ['printContext'],
target: 'cancelDownload',
},
DISMISS: {
actions: 'resetIdInputRef',
target: 'acceptingIdInput',
target: 'cancelDownload',
},
RESEND_OTP: {
target: '.resendOTP',
Expand Down Expand Up @@ -208,7 +202,6 @@ export const AddVcModalMachine =
},
},
cancelDownload: {
entry: 'printContext',
on: {
CANCEL: {
actions: 'resetIdInputRef',
Expand Down
9 changes: 1 addition & 8 deletions screens/Home/MyVcsTabMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,7 @@ export const MyVcsTabMachine = model.createMachine(
guards: {
isMinimumStorageLimitReached: (_context, event) => Boolean(event.data),
isNetworkOn: (_context, event) => Boolean(event.data),
isDownloadCancelled: (context, event) => {
console.log('>>>>>>>>>>>>>> isDownloadCancelledF', Boolean(event.data));
console.log(
'>>>>>>>>>>>>>> isDownloadCancelledF 2222>>>>>>> ',
context,
);
return !Boolean(event.data);
},
isDownloadCancelled: (context, event) => !Boolean(event.data),
},
},
);
Expand Down

0 comments on commit 19f0405

Please sign in to comment.