Remove 'store.user.accessToken' now that we've confirmed nobody uses it.
This commit is contained in:
parent
0c9859e3ac
commit
a8a666383a
6 changed files with 2 additions and 31 deletions
|
@ -1,7 +1,7 @@
|
|||
import { hot } from 'react-hot-loader/root';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectGetSyncErrorMessage, selectSyncFatalError, selectSyncIsLocked } from 'redux/selectors/sync';
|
||||
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
|
||||
import { doUserSetReferrer } from 'redux/actions/user';
|
||||
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doFetchChannelListMine, doFetchCollectionListMine, doResolveUris } from 'redux/actions/claims';
|
||||
|
@ -43,7 +43,6 @@ const select = (state) => ({
|
|||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()),
|
||||
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
||||
|
|
|
@ -60,7 +60,6 @@ type Props = {
|
|||
user: ?{ id: string, has_verified_email: boolean, is_reward_approved: boolean },
|
||||
location: { pathname: string, hash: string, search: string },
|
||||
history: { push: (string) => void },
|
||||
fetchAccessToken: () => void,
|
||||
fetchChannelListMine: () => void,
|
||||
fetchCollectionListMine: () => void,
|
||||
signIn: () => void,
|
||||
|
@ -93,7 +92,6 @@ function App(props: Props) {
|
|||
const {
|
||||
theme,
|
||||
user,
|
||||
fetchAccessToken,
|
||||
fetchChannelListMine,
|
||||
fetchCollectionListMine,
|
||||
signIn,
|
||||
|
@ -285,13 +283,11 @@ function App(props: Props) {
|
|||
ReactModal.setAppElement(wrapperElement);
|
||||
}
|
||||
|
||||
fetchAccessToken();
|
||||
|
||||
// @if TARGET='app'
|
||||
fetchChannelListMine(); // This is fetched after a user is signed in on web
|
||||
fetchCollectionListMine();
|
||||
// @endif
|
||||
}, [appRef, fetchAccessToken, fetchChannelListMine, fetchCollectionListMine]);
|
||||
}, [appRef, fetchChannelListMine, fetchCollectionListMine]);
|
||||
|
||||
useEffect(() => {
|
||||
// $FlowFixMe
|
||||
|
|
|
@ -288,7 +288,6 @@ export const USER_INVITE_STATUS_FETCH_FAILURE = 'USER_INVITE_STATUS_FETCH_FAILUR
|
|||
export const USER_INVITE_NEW_STARTED = 'USER_INVITE_NEW_STARTED';
|
||||
export const USER_INVITE_NEW_SUCCESS = 'USER_INVITE_NEW_SUCCESS';
|
||||
export const USER_INVITE_NEW_FAILURE = 'USER_INVITE_NEW_FAILURE';
|
||||
export const FETCH_ACCESS_TOKEN_SUCCESS = 'FETCH_ACCESS_TOKEN_SUCCESS';
|
||||
export const USER_YOUTUBE_IMPORT_STARTED = 'USER_YOUTUBE_IMPORT_STARTED';
|
||||
export const USER_YOUTUBE_IMPORT_FAILURE = 'USER_YOUTUBE_IMPORT_FAILURE';
|
||||
export const USER_YOUTUBE_IMPORT_SUCCESS = 'USER_YOUTUBE_IMPORT_SUCCESS';
|
||||
|
|
|
@ -573,17 +573,6 @@ export function doUserEmailVerify(verificationToken, recaptcha) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doFetchAccessToken() {
|
||||
return (dispatch) => {
|
||||
const success = (token) =>
|
||||
dispatch({
|
||||
type: ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS,
|
||||
data: { token },
|
||||
});
|
||||
Lbryio.getAuthToken().then(success);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserIdentityVerify(stripeToken) {
|
||||
return (dispatch) => {
|
||||
dispatch({
|
||||
|
|
|
@ -25,7 +25,6 @@ const defaultState = {
|
|||
referralLink: undefined,
|
||||
referralCode: undefined,
|
||||
user: undefined,
|
||||
accessToken: undefined,
|
||||
youtubeChannelImportPending: false,
|
||||
youtubeChannelImportErrorMessage: '',
|
||||
referrerSetIsPending: false,
|
||||
|
@ -36,14 +35,12 @@ reducers[ACTIONS.AUTHENTICATION_STARTED] = (state) =>
|
|||
Object.assign({}, state, {
|
||||
authenticationIsPending: true,
|
||||
userIsPending: true,
|
||||
accessToken: defaultState.accessToken,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.AUTHENTICATION_SUCCESS] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
authenticationIsPending: false,
|
||||
userIsPending: false,
|
||||
accessToken: action.data.accessToken,
|
||||
user: action.data.user,
|
||||
});
|
||||
|
||||
|
@ -221,14 +218,6 @@ reducers[ACTIONS.USER_IDENTITY_VERIFY_FAILURE] = (state, action) =>
|
|||
identityVerifyErrorMessage: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS] = (state, action) => {
|
||||
const { token } = action.data;
|
||||
|
||||
return Object.assign({}, state, {
|
||||
accessToken: token,
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.USER_INVITE_STATUS_FETCH_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
inviteStatusIsPending: true,
|
||||
|
|
|
@ -73,7 +73,6 @@ export const selectUserIsVerificationCandidate = createSelector(
|
|||
(user) => user && (!user.has_verified_email || !user.is_identity_verified)
|
||||
);
|
||||
|
||||
export const selectAccessToken = (state) => selectState(state).accessToken;
|
||||
export const selectUserInviteStatusIsPending = (state) => selectState(state).inviteStatusIsPending;
|
||||
export const selectUserInvitesRemaining = (state) => selectState(state).invitesRemaining;
|
||||
export const selectUserInvitees = (state) => selectState(state).invitees;
|
||||
|
|
Loading…
Reference in a new issue