From d81719ba548350bc0d7a34b8cddf693d1f17bffb Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 6 Aug 2019 12:53:59 -0400 Subject: [PATCH] always populate auth token in redux --- src/ui/component/app/index.js | 3 ++- src/ui/component/app/view.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/component/app/index.js b/src/ui/component/app/index.js index 7184dad9f..73e6ea9d7 100644 --- a/src/ui/component/app/index.js +++ b/src/ui/component/app/index.js @@ -1,7 +1,7 @@ import { hot } from 'react-hot-loader/root'; import { connect } from 'react-redux'; import { doUpdateBlockHeight, doError, doFetchTransactions } from 'lbry-redux'; -import { selectUser, doRewardList, doFetchRewardedContent, selectAccessToken } from 'lbryinc'; +import { selectUser, doRewardList, doFetchRewardedContent, doFetchAccessToken, selectAccessToken } from 'lbryinc'; import { selectThemePath } from 'redux/selectors/settings'; import App from './view'; @@ -17,6 +17,7 @@ const perform = dispatch => ({ fetchRewards: () => dispatch(doRewardList()), fetchRewardedContent: () => dispatch(doFetchRewardedContent()), fetchTransactions: () => dispatch(doFetchTransactions()), + fetchAccessToken: () => dispatch(doFetchAccessToken()), }); export default hot( diff --git a/src/ui/component/app/view.jsx b/src/ui/component/app/view.jsx index 4205e835c..5ef77ee2a 100644 --- a/src/ui/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -23,10 +23,11 @@ type Props = { fetchRewards: () => void, fetchRewardedContent: () => void, fetchTransactions: () => void, + fetchAccessToken: () => void, }; function App(props: Props) { - const { theme, fetchRewards, fetchRewardedContent, fetchTransactions, user, accessToken } = props; + const { theme, fetchRewards, fetchRewardedContent, fetchTransactions, user, fetchAccessToken, accessToken } = props; const appRef = useRef(); const isEnhancedLayout = useKonamiListener(); const userId = user && user.id; @@ -34,6 +35,7 @@ function App(props: Props) { useEffect(() => { ReactModal.setAppElement(appRef.current); + fetchAccessToken(); fetchRewardedContent(); // @if TARGET='app'