From 09cbcf61455dc929a0179cfd79a90cea193fce3d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 30 Mar 2021 00:23:29 -0500 Subject: [PATCH] Don't rely on ['auth', 'me'] --- app/soapbox/actions/me.js | 2 +- app/soapbox/utils/auth.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/actions/me.js b/app/soapbox/actions/me.js index 5b58b50b1..497e08b94 100644 --- a/app/soapbox/actions/me.js +++ b/app/soapbox/actions/me.js @@ -17,7 +17,7 @@ export function fetchMe() { return (dispatch, getState) => { const state = getState(); - const me = state.getIn(['auth', 'me']); + const me = state.get('me') || state.getIn(['auth', 'me']); const token = state.getIn(['auth', 'users', me, 'access_token']); if (!token) { diff --git a/app/soapbox/utils/auth.js b/app/soapbox/utils/auth.js index 6d3bb3d7f..20ae3f842 100644 --- a/app/soapbox/utils/auth.js +++ b/app/soapbox/utils/auth.js @@ -3,6 +3,6 @@ export const isLoggedIn = getState => { }; export const getAccessToken = state => { - const me = state.getIn(['auth', 'me']); + const me = state.get('me'); return state.getIn(['auth', 'users', me, 'access_token']); };