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