From bc3bb4782935886021133129f82d2bed51f0be23 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 29 Apr 2020 19:13:05 -0500 Subject: [PATCH] Refactor hasToken() --- app/gabsocial/actions/me.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/gabsocial/actions/me.js b/app/gabsocial/actions/me.js index 8ee555e0a..27fdc3337 100644 --- a/app/gabsocial/actions/me.js +++ b/app/gabsocial/actions/me.js @@ -9,10 +9,7 @@ export const ME_FETCH_SKIP = 'ME_FETCH_SKIP'; export const ME_PATCH_REQUEST = 'ME_PATCH_REQUEST'; export const ME_PATCH_FAIL = 'ME_PATCH_FAIL'; -function hasToken(getState) { - const accessToken = getState().getIn(['auth', 'user', 'access_token']); - return Boolean(accessToken); -} +const hasToken = getState => getState().hasIn(['auth', 'user', 'access_token']); export function fetchMe() { return (dispatch, getState) => {