Fix login when changing servers
This commit is contained in:
parent
6181c6986e
commit
195a795394
|
@ -388,6 +388,10 @@ const RocketChat = {
|
|||
return resolve(result);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
logout() {
|
||||
return AsyncStorage.clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ export default class LoginView extends React.Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<KeyboardView style={styles.view}>
|
||||
<KeyboardView style={styles.view} keyboardVerticalOffset={64}>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
onChangeText={username => this.setState({ username })}
|
||||
|
|
|
@ -8,6 +8,7 @@ import { connect } from 'react-redux';
|
|||
|
||||
import * as actions from '../actions';
|
||||
import realm from '../lib/realm';
|
||||
import RocketChat from '../lib/rocketchat';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
view: {
|
||||
|
@ -130,6 +131,7 @@ export default class ListServerView extends React.Component {
|
|||
}
|
||||
|
||||
onPressItem = (item) => {
|
||||
RocketChat.logout();
|
||||
Navigation.dismissModal({
|
||||
animationType: 'slide-down'
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue