diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 6c1c6bba..117283d9 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -388,6 +388,10 @@ const RocketChat = { return resolve(result); }); }); + }, + + logout() { + return AsyncStorage.clear(); } }; diff --git a/app/views/login.js b/app/views/login.js index 413bf3d8..3efdbf5e 100644 --- a/app/views/login.js +++ b/app/views/login.js @@ -118,7 +118,7 @@ export default class LoginView extends React.Component { render() { return ( - + this.setState({ username })} diff --git a/app/views/serverList.js b/app/views/serverList.js index 5ba9c030..b572a93c 100644 --- a/app/views/serverList.js +++ b/app/views/serverList.js @@ -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' });