Merge branch 'master' into dashboard-improves

This commit is contained in:
Tom Moor
2017-09-09 07:35:24 -07:00
committed by GitHub
30 changed files with 295 additions and 303 deletions

View File

@@ -2,7 +2,6 @@
import { observable, action, computed, autorunAsync } from 'mobx';
import invariant from 'invariant';
import { client } from 'utils/ApiClient';
import UserStore from 'stores/UserStore';
import type { User, Team } from 'types';
const AUTH_STORE = 'AUTH_STORE';
@@ -72,17 +71,6 @@ class AuthStore {
};
};
getUserStore(): UserStore {
invariant(
this.user && this.team,
'Tried to create a user store without data'
);
return new UserStore({
user: this.user,
team: this.team,
});
}
constructor() {
// Rehydrate
const data = JSON.parse(localStorage.getItem(AUTH_STORE) || '{}');

View File

@@ -1,32 +0,0 @@
// @flow
import { observable, computed } from 'mobx';
import type { User, Team } from 'types';
type Options = {
user: User,
team: Team,
};
class UserStore {
@observable user: User;
@observable team: Team;
@observable isLoading: boolean = false;
/* Computed */
@computed get asJson(): string {
return JSON.stringify({
user: this.user,
team: this.team,
});
}
constructor(options: Options) {
// Rehydrate
this.user = options.user;
this.team = options.team;
}
}
export default UserStore;