File tree Expand file tree Collapse file tree 2 files changed +55
-2
lines changed Expand file tree Collapse file tree 2 files changed +55
-2
lines changed Original file line number Diff line number Diff line change 1+ appId : chat.rocket.reactnative
2+ name : Search
3+ onFlowStart :
4+ - runFlow : ' ../../helpers/setup.yaml'
5+ tags :
6+ - test-13
7+ - android-only
8+
9+ ---
10+ - evalScript : ${output.user = output.utils.createUser()}
11+
12+ - runFlow :
13+ file : ' ../../helpers/login-with-deeplink.yaml'
14+ env :
15+ USERNAME : ${output.user.username}
16+ PASSWORD : ${output.user.password}
17+
18+ - extendedWaitUntil :
19+ visible :
20+ id : ' rooms-list-view-search'
21+ timeout : 60000
22+ - tapOn :
23+ id : rooms-list-view-search
24+ - extendedWaitUntil :
25+ visible :
26+ id : ' rooms-list-view'
27+ timeout : 60000
28+ - extendedWaitUntil :
29+ visible :
30+ id : ' rooms-list-view-search-input'
31+ timeout : 60000
32+ - pressKey : Back
33+ - pressKey : Back
34+ - extendedWaitUntil :
35+ visible :
36+ id : ' rooms-list-view'
37+ timeout : 60000
38+ - extendedWaitUntil :
39+ notVisible :
40+ id : ' rooms-list-view-search-input'
41+ timeout : 60000
Original file line number Diff line number Diff line change 11import { useNavigation } from '@react-navigation/native' ;
2- import React , { memo , useContext } from 'react' ;
3- import { FlatList , RefreshControl } from 'react-native' ;
2+ import React , { memo , useContext , useEffect } from 'react' ;
3+ import { BackHandler , FlatList , RefreshControl } from 'react-native' ;
44import { useSafeAreaFrame } from 'react-native-safe-area-context' ;
55import { shallowEqual } from 'react-redux' ;
66
@@ -51,6 +51,18 @@ const RoomsListView = memo(function RoomsListView() {
5151 const { refreshing, onRefresh } = useRefresh ( { searching } ) ;
5252 const supportedVersionsStatus = useAppSelector ( state => state . supportedVersions . status ) ;
5353
54+ useEffect ( ( ) => {
55+ const subscription = BackHandler . addEventListener ( 'hardwareBackPress' , ( ) => {
56+ if ( searchEnabled ) {
57+ stopSearch ( ) ;
58+ navigation . goBack ( ) ;
59+ return true ;
60+ }
61+ return false ;
62+ } ) ;
63+ return ( ) => subscription . remove ( ) ;
64+ } , [ searchEnabled ] ) ;
65+
5466 const onPressItem = ( item = { } as IRoomItem ) => {
5567 if ( ! navigation . isFocused ( ) ) {
5668 return ;
You can’t perform that action at this time.
0 commit comments