Refactor hasToken()
This commit is contained in:
parent
5c0c1932e0
commit
bc3bb47829
1 changed files with 1 additions and 4 deletions
|
@ -9,10 +9,7 @@ export const ME_FETCH_SKIP = 'ME_FETCH_SKIP';
|
||||||
export const ME_PATCH_REQUEST = 'ME_PATCH_REQUEST';
|
export const ME_PATCH_REQUEST = 'ME_PATCH_REQUEST';
|
||||||
export const ME_PATCH_FAIL = 'ME_PATCH_FAIL';
|
export const ME_PATCH_FAIL = 'ME_PATCH_FAIL';
|
||||||
|
|
||||||
function hasToken(getState) {
|
const hasToken = getState => getState().hasIn(['auth', 'user', 'access_token']);
|
||||||
const accessToken = getState().getIn(['auth', 'user', 'access_token']);
|
|
||||||
return Boolean(accessToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function fetchMe() {
|
export function fetchMe() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
|
Loading…
Reference in a new issue