always populate auth token in redux
This commit is contained in:
parent
b242ae3408
commit
d81719ba54
2 changed files with 5 additions and 2 deletions
|
@ -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(
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue