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 { hot } from 'react-hot-loader/root';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doUpdateBlockHeight, doError, doFetchTransactions } from 'lbry-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 { selectThemePath } from 'redux/selectors/settings';
|
||||||
import App from './view';
|
import App from './view';
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ const perform = dispatch => ({
|
||||||
fetchRewards: () => dispatch(doRewardList()),
|
fetchRewards: () => dispatch(doRewardList()),
|
||||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||||
fetchTransactions: () => dispatch(doFetchTransactions()),
|
fetchTransactions: () => dispatch(doFetchTransactions()),
|
||||||
|
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default hot(
|
export default hot(
|
||||||
|
|
|
@ -23,10 +23,11 @@ type Props = {
|
||||||
fetchRewards: () => void,
|
fetchRewards: () => void,
|
||||||
fetchRewardedContent: () => void,
|
fetchRewardedContent: () => void,
|
||||||
fetchTransactions: () => void,
|
fetchTransactions: () => void,
|
||||||
|
fetchAccessToken: () => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
function App(props: Props) {
|
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 appRef = useRef();
|
||||||
const isEnhancedLayout = useKonamiListener();
|
const isEnhancedLayout = useKonamiListener();
|
||||||
const userId = user && user.id;
|
const userId = user && user.id;
|
||||||
|
@ -34,6 +35,7 @@ function App(props: Props) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
ReactModal.setAppElement(appRef.current);
|
ReactModal.setAppElement(appRef.current);
|
||||||
|
fetchAccessToken();
|
||||||
fetchRewardedContent();
|
fetchRewardedContent();
|
||||||
|
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
|
|
Loading…
Add table
Reference in a new issue