Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions app/views/RoomsListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import {
toggleSortDropdown as toggleSortDropdownAction,
openSearchHeader as openSearchHeaderAction,
closeSearchHeader as closeSearchHeaderAction,
roomsRequest as roomsRequestAction
roomsRequest as roomsRequestAction,
closeServerDropdown as closeServerDropdownAction
} from '../../actions/rooms';
import { appStart as appStartAction } from '../../actions';
import debounce from '../../utils/debounce';
Expand Down Expand Up @@ -138,7 +139,8 @@ class RoomsListView extends React.Component {
openSearchHeader: PropTypes.func,
closeSearchHeader: PropTypes.func,
appStart: PropTypes.func,
roomsRequest: PropTypes.func
roomsRequest: PropTypes.func,
closeServerDropdown: PropTypes.func
};

constructor(props) {
Expand Down Expand Up @@ -176,10 +178,13 @@ class RoomsListView extends React.Component {
this.handleBackPress
);
});
this.willBlurListener = props.navigation.addListener('willBlur', () => BackHandler.addEventListener(
'hardwareBackPress',
this.handleBackPress
));
this.willBlurListener = props.navigation.addListener('willBlur', () => {
props.closeServerDropdown();
BackHandler.addEventListener(
'hardwareBackPress',
this.handleBackPress
);
});
}

componentDidMount() {
Expand Down Expand Up @@ -819,7 +824,8 @@ const mapDispatchToProps = dispatch => ({
closeSearchHeader: () => dispatch(closeSearchHeaderAction()),
appStart: () => dispatch(appStartAction()),
roomsRequest: () => dispatch(roomsRequestAction()),
selectServerRequest: server => dispatch(selectServerRequestAction(server))
selectServerRequest: server => dispatch(selectServerRequestAction(server)),
closeServerDropdown: () => dispatch(closeServerDropdownAction())
});

export default connect(mapStateToProps, mapDispatchToProps)(RoomsListView);