Fix key command
This commit is contained in:
parent
943e179e18
commit
b7e075df02
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { BackHandler, FlatList, Keyboard, RefreshControl, Text, View } from 'react-native';
|
||||
import { connect } from 'react-redux';
|
||||
import { batch, connect } from 'react-redux';
|
||||
import { dequal } from 'dequal';
|
||||
import Orientation from 'react-native-orientation-locker';
|
||||
import { Q } from '@nozbe/watermelondb';
|
||||
|
@ -19,12 +19,13 @@ import {
|
|||
roomsRequest as roomsRequestAction,
|
||||
toggleSortDropdown as toggleSortDropdownAction
|
||||
} from '../../actions/rooms';
|
||||
import { appStart as appStartAction, ROOT_OUTSIDE } from '../../actions/app';
|
||||
import debounce from '../../utils/debounce';
|
||||
import { isIOS, isTablet } from '../../utils/deviceInfo';
|
||||
import * as HeaderButton from '../../containers/HeaderButton';
|
||||
import StatusBar from '../../containers/StatusBar';
|
||||
import ActivityIndicator from '../../containers/ActivityIndicator';
|
||||
import { selectServerRequest as selectServerRequestAction } from '../../actions/server';
|
||||
import { selectServerRequest as selectServerRequestAction, serverInitAdd as serverInitAddAction } from '../../actions/server';
|
||||
import { animateNextTransition } from '../../utils/layoutAnimation';
|
||||
import { withTheme } from '../../theme';
|
||||
import { themes } from '../../constants/colors';
|
||||
|
@ -133,7 +134,8 @@ class RoomsListView extends React.Component {
|
|||
insets: PropTypes.object,
|
||||
queueSize: PropTypes.number,
|
||||
inquiryEnabled: PropTypes.bool,
|
||||
encryptionBanner: PropTypes.string
|
||||
encryptionBanner: PropTypes.string,
|
||||
initAdd: PropTypes.func
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
|
@ -763,7 +765,7 @@ class RoomsListView extends React.Component {
|
|||
};
|
||||
|
||||
handleCommands = ({ event }) => {
|
||||
const { navigation, server, isMasterDetail } = this.props;
|
||||
const { navigation, server, isMasterDetail, appStart, initAdd } = this.props;
|
||||
const { input } = event;
|
||||
if (handleCommandShowPreferences(event)) {
|
||||
navigation.navigate('SettingsView');
|
||||
|
@ -782,7 +784,10 @@ class RoomsListView extends React.Component {
|
|||
navigation.navigate('NewMessageStack');
|
||||
}
|
||||
} else if (handleCommandAddNewServer(event)) {
|
||||
navigation.navigate('NewServerView', { previousServer: server });
|
||||
batch(() => {
|
||||
appStart({ root: ROOT_OUTSIDE });
|
||||
initAdd(server);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -967,7 +972,9 @@ const mapDispatchToProps = dispatch => ({
|
|||
closeSearchHeader: () => dispatch(closeSearchHeaderAction()),
|
||||
roomsRequest: params => dispatch(roomsRequestAction(params)),
|
||||
selectServerRequest: server => dispatch(selectServerRequestAction(server)),
|
||||
closeServerDropdown: () => dispatch(closeServerDropdownAction())
|
||||
closeServerDropdown: () => dispatch(closeServerDropdownAction()),
|
||||
appStart: params => dispatch(appStartAction(params)),
|
||||
initAdd: previousServer => dispatch(serverInitAddAction(previousServer))
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(withDimensions(withTheme(withSafeAreaInsets(RoomsListView))));
|
||||
|
|
Loading…
Reference in New Issue