Fix logout not working properly after moving logic to UserStore

This commit is contained in:
Brett Sun 2016-01-18 19:14:34 +01:00
parent 2ad2ea242d
commit b24e66ed11
1 changed files with 12 additions and 16 deletions

View File

@ -45,25 +45,21 @@ class UserStore {
}
onLogoutCurrentUser() {
this.getInstance()
.performLogoutCurrentUser()
.then(() => {
EventActions.userDidLogout();
// Reset all stores back to their initial state
alt.recycle();
altWhitelabel.recycle();
altUser.recycle();
altThirdParty.recycle();
// Since we've just logged out, we can set this store's
// hasLoaded flag back to true as there is no current user.
this.userMeta.hasLoaded = true;
});
this.getInstance().performLogoutCurrentUser();
}
onSuccessLogoutCurrentUser() {
this.currentUser = {};
EventActions.userDidLogout();
// Reset all stores back to their initial state
alt.recycle();
altWhitelabel.recycle();
altUser.recycle();
altThirdParty.recycle();
// Since we've just logged out, we can set this store's
// hasLoaded flag back to true as there is no current user.
this.userMeta.hasLoaded = true;
}
onErrorCurrentUser(err) {