@@ -59,9 +59,7 @@ const model = createModel(
5959 SELECT_VC : ( vc : VC ) => ( { vc } ) ,
6060 SCAN : ( params : string ) => ( { params } ) ,
6161 ACCEPT_REQUEST : ( shouldVerifySender : boolean ) => ( { shouldVerifySender } ) ,
62- VERIFY_AND_ACCEPT_REQUEST : ( shouldVerifySender : boolean ) => ( {
63- shouldVerifySender,
64- } ) ,
62+ VERIFY_AND_ACCEPT_REQUEST : ( ) => ( { } ) ,
6563 VC_ACCEPTED : ( ) => ( { } ) ,
6664 VC_REJECTED : ( ) => ( { } ) ,
6765 CANCEL : ( ) => ( { } ) ,
@@ -252,22 +250,13 @@ export const scanMachine = model.createMachine(
252250 SELECT_VC : {
253251 actions : [ 'setSelectedVc' ] ,
254252 } ,
255- VERIFY_AND_ACCEPT_REQUEST : [
256- {
257- cond : 'shouldVerifySender' ,
258- target : 'verifyingIdentity' ,
259- } ,
260- {
261- target : 'verifyingIdentity' ,
262- } ,
263- ] ,
264- ACCEPT_REQUEST : [
265- {
266- cond : 'shouldVerifySender' ,
267- actions : 'setShouldVerifyPresence' ,
268- target : 'sendingVc' ,
269- } ,
270- ] ,
253+ VERIFY_AND_ACCEPT_REQUEST : {
254+ target : 'verifyingIdentity' ,
255+ } ,
256+ ACCEPT_REQUEST : {
257+ actions : 'setShouldVerifyPresence' ,
258+ target : 'sendingVc' ,
259+ } ,
271260 CANCEL : '#scan.reviewing.cancelling' ,
272261 } ,
273262 } ,
@@ -480,7 +469,7 @@ export const scanMachine = model.createMachine(
480469 setShouldVerifyPresence : assign ( {
481470 selectedVc : ( context ) => ( {
482471 ...context . selectedVc ,
483- shouldVerifyPresence : true ,
472+ shouldVerifyPresence : context . shouldVerifySender ,
484473 } ) ,
485474 } ) ,
486475 } ,
@@ -675,8 +664,6 @@ export const scanMachine = model.createMachine(
675664 return false ;
676665 }
677666 } ,
678-
679- shouldVerifySender : ( _context , event ) => event . shouldVerifySender ,
680667 } ,
681668
682669 delays : {
0 commit comments