Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Implement "Sign out"
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy Vong committed Aug 22, 2016
1 parent f7e2495 commit 02ededf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/components/AppHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class AppHeader extends Component {
<MenuItem
disabled={!authed}
primaryText="Sign out"
onTouchTap={authStore.logout}
/>
</IconMenu>
}
Expand Down
6 changes: 6 additions & 0 deletions app/store/authStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Auth {
this.client.setAuthInfo(this.provider, token);
this.client.setPosition(0, 0);
this.authed = token;
this.password = '';
return this.client.init();
}).catch((err) => {
this.setNotification({
Expand All @@ -97,6 +98,11 @@ class Auth {
return new Promise((resolve, reject) => reject('Unable to login'));
}

logout = action('logout', () => {
this.authed = false;
this._pokemon.clear();
})

savedFileCheck = action('savedFileCheck', () => {
this.hasSavedData = fs.existsSync(FILENAME);
});
Expand Down

0 comments on commit 02ededf

Please sign in to comment.