File tree Expand file tree Collapse file tree
examples/test-app/src/screens Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,22 +84,25 @@ export function AutomationLabScreen(props: {
8484 } ;
8585 } , [ ] ) ;
8686
87+ useEffect ( ( ) => {
88+ if ( alertResult !== 'opened' ) return ;
89+
90+ // The opened canary is committed before this effect; the smoke step separately waits for native presentation.
91+ Alert . alert ( 'Automation confirmation' , 'Choose either result to update the visible canary.' , [
92+ {
93+ style : 'cancel' ,
94+ text : 'Cancel' ,
95+ onPress : ( ) => setAlertResult ( 'cancelled' ) ,
96+ } ,
97+ {
98+ text : 'OK' ,
99+ onPress : ( ) => setAlertResult ( 'accepted' ) ,
100+ } ,
101+ ] ) ;
102+ } , [ alertResult ] ) ;
103+
87104 function showAutomationAlert ( ) {
88105 setAlertResult ( 'opened' ) ;
89- setTimeout ( ( ) => {
90- // The opened canary proves JS ran; the smoke step separately waits for native presentation.
91- Alert . alert ( 'Automation confirmation' , 'Choose either result to update the visible canary.' , [
92- {
93- style : 'cancel' ,
94- text : 'Cancel' ,
95- onPress : ( ) => setAlertResult ( 'cancelled' ) ,
96- } ,
97- {
98- text : 'OK' ,
99- onPress : ( ) => setAlertResult ( 'accepted' ) ,
100- } ,
101- ] ) ;
102- } ) ;
103106 }
104107
105108 async function requestMicrophonePermission ( ) {
You can’t perform that action at this time.
0 commit comments