commit
75f992ef02
9 changed files with 1068 additions and 57 deletions
345
dist/bundle.es.js
vendored
345
dist/bundle.es.js
vendored
|
@ -19,7 +19,9 @@ const USER_EMAIL_DECLINE = 'USER_EMAIL_DECLINE';
|
|||
const USER_EMAIL_NEW_STARTED = 'USER_EMAIL_NEW_STARTED';
|
||||
const USER_EMAIL_NEW_SUCCESS = 'USER_EMAIL_NEW_SUCCESS';
|
||||
const USER_EMAIL_NEW_EXISTS = 'USER_EMAIL_NEW_EXISTS';
|
||||
const USER_EMAIL_NEW_DOES_NOT_EXIST = 'USER_EMAIL_NEW_DOES_NOT_EXIST';
|
||||
const USER_EMAIL_NEW_FAILURE = 'USER_EMAIL_NEW_FAILURE';
|
||||
const USER_EMAIL_NEW_CLEAR_ENTRY = 'USER_EMAIL_NEW_CLEAR_ENTRY';
|
||||
const USER_EMAIL_VERIFY_SET = 'USER_EMAIL_VERIFY_SET';
|
||||
const USER_EMAIL_VERIFY_STARTED = 'USER_EMAIL_VERIFY_STARTED';
|
||||
const USER_EMAIL_VERIFY_SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS';
|
||||
|
@ -27,6 +29,14 @@ const USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE';
|
|||
const USER_EMAIL_VERIFY_RETRY_STARTED = 'USER_EMAIL_VERIFY_RETRY_STARTED';
|
||||
const USER_EMAIL_VERIFY_RETRY_FAILURE = 'USER_EMAIL_VERIFY_RETRY_FAILURE';
|
||||
const USER_EMAIL_VERIFY_RETRY_SUCCESS = 'USER_EMAIL_VERIFY_RETRY_SUCCESS';
|
||||
const USER_PASSWORD_EXISTS = 'USER_PASSWORD_EXISTS';
|
||||
const USER_PASSWORD_RESET_STARTED = 'USER_PASSWORD_RESET_STARTED';
|
||||
const USER_PASSWORD_RESET_SUCCESS = 'USER_PASSWORD_RESET_SUCCESS';
|
||||
const USER_PASSWORD_RESET_FAILURE = 'USER_PASSWORD_RESET_FAILURE';
|
||||
const USER_PASSWORD_SET_STARTED = 'USER_PASSWORD_SET_STARTED';
|
||||
const USER_PASSWORD_SET_SUCCESS = 'USER_PASSWORD_SET_SUCCESS';
|
||||
const USER_PASSWORD_SET_FAILURE = 'USER_PASSWORD_SET_FAILURE';
|
||||
const USER_PASSWORD_SET_CLEAR = 'USER_PASSWORD_SET_CLEAR';
|
||||
const USER_PHONE_RESET = 'USER_PHONE_RESET';
|
||||
const USER_PHONE_NEW_STARTED = 'USER_PHONE_NEW_STARTED';
|
||||
const USER_PHONE_NEW_SUCCESS = 'USER_PHONE_NEW_SUCCESS';
|
||||
|
@ -149,7 +159,9 @@ var action_types = /*#__PURE__*/Object.freeze({
|
|||
USER_EMAIL_NEW_STARTED: USER_EMAIL_NEW_STARTED,
|
||||
USER_EMAIL_NEW_SUCCESS: USER_EMAIL_NEW_SUCCESS,
|
||||
USER_EMAIL_NEW_EXISTS: USER_EMAIL_NEW_EXISTS,
|
||||
USER_EMAIL_NEW_DOES_NOT_EXIST: USER_EMAIL_NEW_DOES_NOT_EXIST,
|
||||
USER_EMAIL_NEW_FAILURE: USER_EMAIL_NEW_FAILURE,
|
||||
USER_EMAIL_NEW_CLEAR_ENTRY: USER_EMAIL_NEW_CLEAR_ENTRY,
|
||||
USER_EMAIL_VERIFY_SET: USER_EMAIL_VERIFY_SET,
|
||||
USER_EMAIL_VERIFY_STARTED: USER_EMAIL_VERIFY_STARTED,
|
||||
USER_EMAIL_VERIFY_SUCCESS: USER_EMAIL_VERIFY_SUCCESS,
|
||||
|
@ -157,6 +169,14 @@ var action_types = /*#__PURE__*/Object.freeze({
|
|||
USER_EMAIL_VERIFY_RETRY_STARTED: USER_EMAIL_VERIFY_RETRY_STARTED,
|
||||
USER_EMAIL_VERIFY_RETRY_FAILURE: USER_EMAIL_VERIFY_RETRY_FAILURE,
|
||||
USER_EMAIL_VERIFY_RETRY_SUCCESS: USER_EMAIL_VERIFY_RETRY_SUCCESS,
|
||||
USER_PASSWORD_EXISTS: USER_PASSWORD_EXISTS,
|
||||
USER_PASSWORD_RESET_STARTED: USER_PASSWORD_RESET_STARTED,
|
||||
USER_PASSWORD_RESET_SUCCESS: USER_PASSWORD_RESET_SUCCESS,
|
||||
USER_PASSWORD_RESET_FAILURE: USER_PASSWORD_RESET_FAILURE,
|
||||
USER_PASSWORD_SET_STARTED: USER_PASSWORD_SET_STARTED,
|
||||
USER_PASSWORD_SET_SUCCESS: USER_PASSWORD_SET_SUCCESS,
|
||||
USER_PASSWORD_SET_FAILURE: USER_PASSWORD_SET_FAILURE,
|
||||
USER_PASSWORD_SET_CLEAR: USER_PASSWORD_SET_CLEAR,
|
||||
USER_PHONE_RESET: USER_PHONE_RESET,
|
||||
USER_PHONE_NEW_STARTED: USER_PHONE_NEW_STARTED,
|
||||
USER_PHONE_NEW_SUCCESS: USER_PHONE_NEW_SUCCESS,
|
||||
|
@ -1214,6 +1234,7 @@ const selectAuthenticationIsPending = reselect.createSelector(selectState$2, sta
|
|||
const selectUserIsPending = reselect.createSelector(selectState$2, state => state.userIsPending);
|
||||
const selectUser = reselect.createSelector(selectState$2, state => state.user);
|
||||
const selectEmailAlreadyExists = reselect.createSelector(selectState$2, state => state.emailAlreadyExists);
|
||||
const selectEmailDoesNotExist = reselect.createSelector(selectState$2, state => state.emailDoesNotExist);
|
||||
const selectResendingVerificationEmail = reselect.createSelector(selectState$2, state => state.resendingVerificationEmail);
|
||||
const selectUserEmail = reselect.createSelector(selectUser, user => user ? user.primary_email : null);
|
||||
const selectUserPhone = reselect.createSelector(selectUser, user => user ? user.phone_number : null);
|
||||
|
@ -1223,7 +1244,23 @@ const selectPhoneToVerify = reselect.createSelector(selectState$2, selectUserPho
|
|||
const selectYoutubeChannels = reselect.createSelector(selectUser, user => user ? user.youtube_channels : null);
|
||||
const selectUserIsRewardApproved = reselect.createSelector(selectUser, user => user && user.is_reward_approved);
|
||||
const selectEmailNewIsPending = reselect.createSelector(selectState$2, state => state.emailNewIsPending);
|
||||
const selectEmailNewErrorMessage = reselect.createSelector(selectState$2, state => state.emailNewErrorMessage);
|
||||
const selectEmailNewErrorMessage = reselect.createSelector(selectState$2, state => {
|
||||
const error = state.emailNewErrorMessage;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
const selectPasswordExists = reselect.createSelector(selectState$2, state => state.passwordExistsForUser);
|
||||
const selectPasswordResetIsPending = reselect.createSelector(selectState$2, state => state.passwordResetPending);
|
||||
const selectPasswordResetSuccess = reselect.createSelector(selectState$2, state => state.passwordResetSuccess);
|
||||
const selectPasswordResetError = reselect.createSelector(selectState$2, state => {
|
||||
const error = state.passwordResetError;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
const selectPasswordSetIsPending = reselect.createSelector(selectState$2, state => state.passwordSetPending);
|
||||
const selectPasswordSetSuccess = reselect.createSelector(selectState$2, state => state.passwordSetSuccess);
|
||||
const selectPasswordSetError = reselect.createSelector(selectState$2, state => {
|
||||
const error = state.passwordSetError;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
const selectPhoneNewErrorMessage = reselect.createSelector(selectState$2, state => state.phoneNewErrorMessage);
|
||||
const selectEmailVerifyIsPending = reselect.createSelector(selectState$2, state => state.emailVerifyIsPending);
|
||||
const selectEmailVerifyErrorMessage = reselect.createSelector(selectState$2, state => state.emailVerifyErrorMessage);
|
||||
|
@ -1307,7 +1344,7 @@ function doInstallNew(appVersion, os = null, firebaseToken = null, callbackForUs
|
|||
});
|
||||
}
|
||||
function doInstallNewWithParams(appVersion, installationId, nodeId, lbrynetVersion, os, platform, firebaseToken = null) {
|
||||
return dispatch => {
|
||||
return () => {
|
||||
const payload = {
|
||||
app_version: appVersion
|
||||
};
|
||||
|
@ -1361,23 +1398,27 @@ function doAuthenticate(appVersion, os = null, firebaseToken = null, shareUsageD
|
|||
}
|
||||
function doUserFetch() {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_FETCH_STARTED
|
||||
});
|
||||
Lbryio.getCurrentUser().then(user => {
|
||||
dispatch(doRewardList());
|
||||
return new Promise((resolve, reject) => {
|
||||
dispatch({
|
||||
type: USER_FETCH_SUCCESS,
|
||||
data: {
|
||||
user
|
||||
}
|
||||
type: USER_FETCH_STARTED
|
||||
});
|
||||
}).catch(error => {
|
||||
dispatch({
|
||||
type: USER_FETCH_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
Lbryio.getCurrentUser().then(user => {
|
||||
dispatch(doRewardList());
|
||||
dispatch({
|
||||
type: USER_FETCH_SUCCESS,
|
||||
data: {
|
||||
user
|
||||
}
|
||||
});
|
||||
resolve(user);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
dispatch({
|
||||
type: USER_FETCH_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1524,6 +1565,188 @@ function doUserEmailNew(email) {
|
|||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserCheckIfEmailExists(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_STARTED,
|
||||
email
|
||||
});
|
||||
|
||||
const success = response => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_SUCCESS,
|
||||
data: {
|
||||
email
|
||||
}
|
||||
});
|
||||
|
||||
if (response.has_password) {
|
||||
dispatch({
|
||||
type: USER_PASSWORD_EXISTS
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const failure = error => dispatch({
|
||||
type: USER_EMAIL_NEW_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
|
||||
Lbryio.call('user', 'exists', {
|
||||
email
|
||||
}, 'post').catch(error => {
|
||||
if (error.response && error.response.status === 404) {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_DOES_NOT_EXIST
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserSignIn(email, password) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_STARTED,
|
||||
email
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_SUCCESS,
|
||||
data: {
|
||||
email
|
||||
}
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error => dispatch({
|
||||
type: USER_EMAIL_NEW_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
|
||||
Lbryio.call('user', 'signin', {
|
||||
email,
|
||||
...(password ? {
|
||||
password
|
||||
} : {})
|
||||
}, 'post').catch(error => {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_EXISTS
|
||||
});
|
||||
return Lbryio.call('user_email', 'resend_token', {
|
||||
email,
|
||||
only_if_expired: true
|
||||
}, 'post').then(success, failure);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserSignUp(email, password) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_STARTED,
|
||||
email
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_SUCCESS,
|
||||
data: {
|
||||
email
|
||||
}
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error => {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_EXISTS
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: USER_EMAIL_NEW_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Lbryio.call('user', 'signup', {
|
||||
email,
|
||||
...(password ? {
|
||||
password
|
||||
} : {})
|
||||
}, 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserPasswordReset(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_PASSWORD_RESET_STARTED,
|
||||
email
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: USER_PASSWORD_RESET_SUCCESS
|
||||
});
|
||||
};
|
||||
|
||||
const failure = error => dispatch({
|
||||
type: USER_PASSWORD_RESET_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
|
||||
Lbryio.call('user_password', 'reset', {
|
||||
email
|
||||
}, 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserPasswordSet(newPassword, oldPassword, authToken) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: USER_PASSWORD_SET_STARTED
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: USER_PASSWORD_SET_SUCCESS
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error => dispatch({
|
||||
type: USER_PASSWORD_SET_FAILURE,
|
||||
data: {
|
||||
error
|
||||
}
|
||||
});
|
||||
|
||||
Lbryio.call('user_password', 'set', {
|
||||
new_password: newPassword,
|
||||
...(oldPassword ? {
|
||||
old_password: oldPassword
|
||||
} : {}),
|
||||
...(authToken ? {
|
||||
auth_token: authToken
|
||||
} : {})
|
||||
}, 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserResendVerificationEmail(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
|
@ -1554,6 +1777,16 @@ function doUserResendVerificationEmail(email) {
|
|||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doClearEmailEntry() {
|
||||
return {
|
||||
type: USER_EMAIL_NEW_CLEAR_ENTRY
|
||||
};
|
||||
}
|
||||
function doClearPasswordEntries() {
|
||||
return {
|
||||
type: USER_PASSWORD_SET_CLEAR
|
||||
};
|
||||
}
|
||||
function doUserEmailVerifyFailure(error) {
|
||||
return {
|
||||
type: USER_EMAIL_VERIFY_FAILURE,
|
||||
|
@ -3035,7 +3268,14 @@ const defaultState$3 = {
|
|||
emailNewErrorMessage: '',
|
||||
emailToVerify: '',
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
resendingVerificationEmail: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: false,
|
||||
passwordResetError: undefined,
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: false,
|
||||
passwordSetError: undefined,
|
||||
inviteNewErrorMessage: '',
|
||||
inviteNewIsPending: false,
|
||||
inviteStatusIsPending: false,
|
||||
|
@ -3128,7 +3368,8 @@ reducers$2[USER_PHONE_VERIFY_FAILURE] = (state, action) => Object.assign({}, sta
|
|||
reducers$2[USER_EMAIL_NEW_STARTED] = state => Object.assign({}, state, {
|
||||
emailNewIsPending: true,
|
||||
emailNewErrorMessage: '',
|
||||
emailAlreadyExists: false
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false
|
||||
});
|
||||
|
||||
reducers$2[USER_EMAIL_NEW_SUCCESS] = (state, action) => {
|
||||
|
@ -3145,11 +3386,29 @@ reducers$2[USER_EMAIL_NEW_EXISTS] = state => Object.assign({}, state, {
|
|||
emailAlreadyExists: true
|
||||
});
|
||||
|
||||
reducers$2[USER_EMAIL_NEW_DOES_NOT_EXIST] = state => Object.assign({}, state, {
|
||||
emailDoesNotExist: true
|
||||
});
|
||||
|
||||
reducers$2[USER_EMAIL_NEW_FAILURE] = (state, action) => Object.assign({}, state, {
|
||||
emailNewIsPending: false,
|
||||
emailNewErrorMessage: action.data.error
|
||||
});
|
||||
|
||||
reducers$2[USER_EMAIL_NEW_CLEAR_ENTRY] = state => Object.assign({}, state, {
|
||||
emailNewErrorMessage: null,
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
passwordExistsForUser: false,
|
||||
emailToVerify: null
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_SET_CLEAR] = state => Object.assign({}, state, {
|
||||
passwordResetSuccess: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetError: null
|
||||
});
|
||||
|
||||
reducers$2[USER_EMAIL_VERIFY_STARTED] = state => Object.assign({}, state, {
|
||||
emailVerifyIsPending: true,
|
||||
emailVerifyErrorMessage: ''
|
||||
|
@ -3285,6 +3544,41 @@ reducers$2[USER_SET_REFERRER_RESET] = state => Object.assign({}, state, {
|
|||
referrerSetError: defaultState$3.referrerSetError
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_EXISTS] = state => Object.assign({}, state, {
|
||||
passwordExistsForUser: true
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_RESET_STARTED] = state => Object.assign({}, state, {
|
||||
passwordResetPending: true,
|
||||
passwordResetSuccess: defaultState$3.passwordResetSuccess,
|
||||
passwordResetError: null
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_RESET_SUCCESS] = state => Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: true
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_RESET_FAILURE] = (state, action) => Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetError: action.data.error
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_SET_STARTED] = state => Object.assign({}, state, {
|
||||
passwordSetPending: true,
|
||||
passwordSetSuccess: defaultState$3.passwordSetSuccess
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_SET_SUCCESS] = state => Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: true
|
||||
});
|
||||
|
||||
reducers$2[USER_PASSWORD_SET_FAILURE] = (state, action) => Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetError: action.data.error
|
||||
});
|
||||
|
||||
function userReducer(state = defaultState$3, action) {
|
||||
const handler = reducers$2[action.type];
|
||||
if (handler) return handler(state, action);
|
||||
|
@ -3677,6 +3971,8 @@ exports.doClaimEligiblePurchaseRewards = doClaimEligiblePurchaseRewards;
|
|||
exports.doClaimRewardClearError = doClaimRewardClearError;
|
||||
exports.doClaimRewardType = doClaimRewardType;
|
||||
exports.doClaimYoutubeChannels = doClaimYoutubeChannels;
|
||||
exports.doClearEmailEntry = doClearEmailEntry;
|
||||
exports.doClearPasswordEntries = doClearPasswordEntries;
|
||||
exports.doCompleteFirstRun = doCompleteFirstRun;
|
||||
exports.doFetchAccessToken = doFetchAccessToken;
|
||||
exports.doFetchCostInfoForUri = doFetchCostInfoForUri;
|
||||
|
@ -3707,6 +4003,7 @@ exports.doTransifexUpload = doTransifexUpload;
|
|||
exports.doUpdateUnreadSubscriptions = doUpdateUnreadSubscriptions;
|
||||
exports.doUpdateUploadProgress = doUpdateUploadProgress;
|
||||
exports.doUserCheckEmailVerified = doUserCheckEmailVerified;
|
||||
exports.doUserCheckIfEmailExists = doUserCheckIfEmailExists;
|
||||
exports.doUserEmailNew = doUserEmailNew;
|
||||
exports.doUserEmailToVerify = doUserEmailToVerify;
|
||||
exports.doUserEmailVerify = doUserEmailVerify;
|
||||
|
@ -3714,6 +4011,8 @@ exports.doUserEmailVerifyFailure = doUserEmailVerifyFailure;
|
|||
exports.doUserFetch = doUserFetch;
|
||||
exports.doUserIdentityVerify = doUserIdentityVerify;
|
||||
exports.doUserInviteNew = doUserInviteNew;
|
||||
exports.doUserPasswordReset = doUserPasswordReset;
|
||||
exports.doUserPasswordSet = doUserPasswordSet;
|
||||
exports.doUserPhoneNew = doUserPhoneNew;
|
||||
exports.doUserPhoneReset = doUserPhoneReset;
|
||||
exports.doUserPhoneVerify = doUserPhoneVerify;
|
||||
|
@ -3721,6 +4020,8 @@ exports.doUserPhoneVerifyFailure = doUserPhoneVerifyFailure;
|
|||
exports.doUserResendVerificationEmail = doUserResendVerificationEmail;
|
||||
exports.doUserSetReferrer = doUserSetReferrer;
|
||||
exports.doUserSetReferrerReset = doUserSetReferrerReset;
|
||||
exports.doUserSignIn = doUserSignIn;
|
||||
exports.doUserSignUp = doUserSignUp;
|
||||
exports.filteredReducer = filteredReducer;
|
||||
exports.homepageReducer = homepageReducer;
|
||||
exports.lbrytvReducer = lbrytvReducer;
|
||||
|
@ -3750,6 +4051,7 @@ exports.selectClaimedRewardsByTransactionId = selectClaimedRewardsByTransactionI
|
|||
exports.selectClaimsPendingByType = selectClaimsPendingByType;
|
||||
exports.selectCurrentUploads = selectCurrentUploads;
|
||||
exports.selectEmailAlreadyExists = selectEmailAlreadyExists;
|
||||
exports.selectEmailDoesNotExist = selectEmailDoesNotExist;
|
||||
exports.selectEmailNewErrorMessage = selectEmailNewErrorMessage;
|
||||
exports.selectEmailNewIsPending = selectEmailNewIsPending;
|
||||
exports.selectEmailToVerify = selectEmailToVerify;
|
||||
|
@ -3772,6 +4074,13 @@ exports.selectIdentityVerifyIsPending = selectIdentityVerifyIsPending;
|
|||
exports.selectIsAuthenticating = selectIsAuthenticating;
|
||||
exports.selectIsFetchingSubscriptions = selectIsFetchingSubscriptions;
|
||||
exports.selectIsFetchingSuggested = selectIsFetchingSuggested;
|
||||
exports.selectPasswordExists = selectPasswordExists;
|
||||
exports.selectPasswordResetError = selectPasswordResetError;
|
||||
exports.selectPasswordResetIsPending = selectPasswordResetIsPending;
|
||||
exports.selectPasswordResetSuccess = selectPasswordResetSuccess;
|
||||
exports.selectPasswordSetError = selectPasswordSetError;
|
||||
exports.selectPasswordSetIsPending = selectPasswordSetIsPending;
|
||||
exports.selectPasswordSetSuccess = selectPasswordSetSuccess;
|
||||
exports.selectPhoneNewErrorMessage = selectPhoneNewErrorMessage;
|
||||
exports.selectPhoneNewIsPending = selectPhoneNewIsPending;
|
||||
exports.selectPhoneToVerify = selectPhoneToVerify;
|
||||
|
|
415
dist/bundle.js
vendored
415
dist/bundle.js
vendored
|
@ -179,6 +179,10 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserFetch", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserFetch"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserSignIn", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserSignIn"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserSignUp", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserSignUp"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserEmailNew"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckEmailVerified", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserCheckEmailVerified"]; });
|
||||
|
@ -213,6 +217,16 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserSetReferrerReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserSetReferrerReset"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPasswordReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserPasswordReset"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPasswordSet", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserPasswordSet"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckIfEmailExists", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doUserCheckIfEmailExists"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClearEmailEntry", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doClearEmailEntry"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClearPasswordEntries", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_11__["doClearPasswordEntries"]; });
|
||||
|
||||
/* harmony import */ var redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(30);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_12__["doFetchCostInfoForUri"]; });
|
||||
|
||||
|
@ -386,6 +400,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailAlreadyExists", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectEmailAlreadyExists"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailDoesNotExist", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectEmailDoesNotExist"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectResendingVerificationEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectResendingVerificationEmail"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPhoneVerifyErrorMessage"]; });
|
||||
|
@ -430,6 +446,20 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetReferrerError", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectSetReferrerError"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordResetIsPending"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetSuccess", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordResetSuccess"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetError", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordResetError"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordSetIsPending"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetSuccess", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordSetSuccess"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetError", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordSetError"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPasswordExists", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_32__["selectPasswordExists"]; });
|
||||
|
||||
/* harmony import */ var redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(48);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_33__["makeSelectFetchingCostInfoForUri"]; });
|
||||
|
||||
|
@ -554,7 +584,9 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_STARTED", function() { return USER_EMAIL_NEW_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_SUCCESS", function() { return USER_EMAIL_NEW_SUCCESS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_EXISTS", function() { return USER_EMAIL_NEW_EXISTS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_DOES_NOT_EXIST", function() { return USER_EMAIL_NEW_DOES_NOT_EXIST; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_FAILURE", function() { return USER_EMAIL_NEW_FAILURE; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_NEW_CLEAR_ENTRY", function() { return USER_EMAIL_NEW_CLEAR_ENTRY; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_SET", function() { return USER_EMAIL_VERIFY_SET; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_STARTED", function() { return USER_EMAIL_VERIFY_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_SUCCESS", function() { return USER_EMAIL_VERIFY_SUCCESS; });
|
||||
|
@ -562,6 +594,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_RETRY_STARTED", function() { return USER_EMAIL_VERIFY_RETRY_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_RETRY_FAILURE", function() { return USER_EMAIL_VERIFY_RETRY_FAILURE; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_RETRY_SUCCESS", function() { return USER_EMAIL_VERIFY_RETRY_SUCCESS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_EXISTS", function() { return USER_PASSWORD_EXISTS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_RESET_STARTED", function() { return USER_PASSWORD_RESET_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_RESET_SUCCESS", function() { return USER_PASSWORD_RESET_SUCCESS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_RESET_FAILURE", function() { return USER_PASSWORD_RESET_FAILURE; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_SET_STARTED", function() { return USER_PASSWORD_SET_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_SET_SUCCESS", function() { return USER_PASSWORD_SET_SUCCESS; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_SET_FAILURE", function() { return USER_PASSWORD_SET_FAILURE; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PASSWORD_SET_CLEAR", function() { return USER_PASSWORD_SET_CLEAR; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_RESET", function() { return USER_PHONE_RESET; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_NEW_STARTED", function() { return USER_PHONE_NEW_STARTED; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_NEW_SUCCESS", function() { return USER_PHONE_NEW_SUCCESS; });
|
||||
|
@ -675,7 +715,9 @@ var USER_EMAIL_DECLINE = 'USER_EMAIL_DECLINE';
|
|||
var USER_EMAIL_NEW_STARTED = 'USER_EMAIL_NEW_STARTED';
|
||||
var USER_EMAIL_NEW_SUCCESS = 'USER_EMAIL_NEW_SUCCESS';
|
||||
var USER_EMAIL_NEW_EXISTS = 'USER_EMAIL_NEW_EXISTS';
|
||||
var USER_EMAIL_NEW_DOES_NOT_EXIST = 'USER_EMAIL_NEW_DOES_NOT_EXIST';
|
||||
var USER_EMAIL_NEW_FAILURE = 'USER_EMAIL_NEW_FAILURE';
|
||||
var USER_EMAIL_NEW_CLEAR_ENTRY = 'USER_EMAIL_NEW_CLEAR_ENTRY';
|
||||
var USER_EMAIL_VERIFY_SET = 'USER_EMAIL_VERIFY_SET';
|
||||
var USER_EMAIL_VERIFY_STARTED = 'USER_EMAIL_VERIFY_STARTED';
|
||||
var USER_EMAIL_VERIFY_SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS';
|
||||
|
@ -683,6 +725,14 @@ var USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE';
|
|||
var USER_EMAIL_VERIFY_RETRY_STARTED = 'USER_EMAIL_VERIFY_RETRY_STARTED';
|
||||
var USER_EMAIL_VERIFY_RETRY_FAILURE = 'USER_EMAIL_VERIFY_RETRY_FAILURE';
|
||||
var USER_EMAIL_VERIFY_RETRY_SUCCESS = 'USER_EMAIL_VERIFY_RETRY_SUCCESS';
|
||||
var USER_PASSWORD_EXISTS = 'USER_PASSWORD_EXISTS';
|
||||
var USER_PASSWORD_RESET_STARTED = 'USER_PASSWORD_RESET_STARTED';
|
||||
var USER_PASSWORD_RESET_SUCCESS = 'USER_PASSWORD_RESET_SUCCESS';
|
||||
var USER_PASSWORD_RESET_FAILURE = 'USER_PASSWORD_RESET_FAILURE';
|
||||
var USER_PASSWORD_SET_STARTED = 'USER_PASSWORD_SET_STARTED';
|
||||
var USER_PASSWORD_SET_SUCCESS = 'USER_PASSWORD_SET_SUCCESS';
|
||||
var USER_PASSWORD_SET_FAILURE = 'USER_PASSWORD_SET_FAILURE';
|
||||
var USER_PASSWORD_SET_CLEAR = 'USER_PASSWORD_SET_CLEAR';
|
||||
var USER_PHONE_RESET = 'USER_PHONE_RESET';
|
||||
var USER_PHONE_NEW_STARTED = 'USER_PHONE_NEW_STARTED';
|
||||
var USER_PHONE_NEW_SUCCESS = 'USER_PHONE_NEW_SUCCESS';
|
||||
|
@ -4683,6 +4733,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserIsPending", function() { return selectUserIsPending; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUser", function() { return selectUser; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailAlreadyExists", function() { return selectEmailAlreadyExists; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailDoesNotExist", function() { return selectEmailDoesNotExist; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectResendingVerificationEmail", function() { return selectResendingVerificationEmail; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserEmail", function() { return selectUserEmail; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserPhone", function() { return selectUserPhone; });
|
||||
|
@ -4693,6 +4744,13 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserIsRewardApproved", function() { return selectUserIsRewardApproved; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewIsPending", function() { return selectEmailNewIsPending; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewErrorMessage", function() { return selectEmailNewErrorMessage; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordExists", function() { return selectPasswordExists; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetIsPending", function() { return selectPasswordResetIsPending; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetSuccess", function() { return selectPasswordResetSuccess; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordResetError", function() { return selectPasswordResetError; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetIsPending", function() { return selectPasswordSetIsPending; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetSuccess", function() { return selectPasswordSetSuccess; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPasswordSetError", function() { return selectPasswordSetError; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewErrorMessage", function() { return selectPhoneNewErrorMessage; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyIsPending", function() { return selectEmailVerifyIsPending; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyErrorMessage", function() { return selectEmailVerifyErrorMessage; });
|
||||
|
@ -4719,6 +4777,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportVideosComplete", function() { return selectYouTubeImportVideosComplete; });
|
||||
/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
||||
/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__);
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
|
||||
var selectState = function selectState(state) {
|
||||
return state.user || {};
|
||||
|
@ -4735,6 +4795,9 @@ var selectUser = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])
|
|||
var selectEmailAlreadyExists = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.emailAlreadyExists;
|
||||
});
|
||||
var selectEmailDoesNotExist = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.emailDoesNotExist;
|
||||
});
|
||||
var selectResendingVerificationEmail = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.resendingVerificationEmail;
|
||||
});
|
||||
|
@ -4763,7 +4826,31 @@ var selectEmailNewIsPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["crea
|
|||
return state.emailNewIsPending;
|
||||
});
|
||||
var selectEmailNewErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.emailNewErrorMessage;
|
||||
var error = state.emailNewErrorMessage;
|
||||
return _typeof(error) === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
var selectPasswordExists = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.passwordExistsForUser;
|
||||
});
|
||||
var selectPasswordResetIsPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.passwordResetPending;
|
||||
});
|
||||
var selectPasswordResetSuccess = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.passwordResetSuccess;
|
||||
});
|
||||
var selectPasswordResetError = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
var error = state.passwordResetError;
|
||||
return _typeof(error) === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
var selectPasswordSetIsPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.passwordSetPending;
|
||||
});
|
||||
var selectPasswordSetSuccess = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.passwordSetSuccess;
|
||||
});
|
||||
var selectPasswordSetError = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
var error = state.passwordSetError;
|
||||
return _typeof(error) === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
var selectPhoneNewErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) {
|
||||
return state.phoneNewErrorMessage;
|
||||
|
@ -4861,7 +4948,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerify", function() { return doUserPhoneVerify; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserEmailToVerify", function() { return doUserEmailToVerify; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return doUserEmailNew; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserCheckIfEmailExists", function() { return doUserCheckIfEmailExists; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserSignIn", function() { return doUserSignIn; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserSignUp", function() { return doUserSignUp; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserPasswordReset", function() { return doUserPasswordReset; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserPasswordSet", function() { return doUserPasswordSet; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserResendVerificationEmail", function() { return doUserResendVerificationEmail; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClearEmailEntry", function() { return doClearEmailEntry; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClearPasswordEntries", function() { return doClearPasswordEntries; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerifyFailure", function() { return doUserEmailVerifyFailure; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerify", function() { return doUserEmailVerify; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchAccessToken", function() { return doFetchAccessToken; });
|
||||
|
@ -4882,6 +4976,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|||
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
||||
|
@ -4955,7 +5053,7 @@ function doInstallNew(appVersion) {
|
|||
}
|
||||
function doInstallNewWithParams(appVersion, installationId, nodeId, lbrynetVersion, os, platform) {
|
||||
var firebaseToken = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
|
||||
return function (dispatch) {
|
||||
return function () {
|
||||
var payload = {
|
||||
app_version: appVersion
|
||||
};
|
||||
|
@ -5014,23 +5112,27 @@ function doAuthenticate(appVersion) {
|
|||
}
|
||||
function doUserFetch() {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_STARTED"]
|
||||
});
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].getCurrentUser().then(function (user) {
|
||||
dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])());
|
||||
return new Promise(function (resolve, reject) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_SUCCESS"],
|
||||
data: {
|
||||
user: user
|
||||
}
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_STARTED"]
|
||||
});
|
||||
})["catch"](function (error) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].getCurrentUser().then(function (user) {
|
||||
dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])());
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_SUCCESS"],
|
||||
data: {
|
||||
user: user
|
||||
}
|
||||
});
|
||||
resolve(user);
|
||||
})["catch"](function (error) {
|
||||
reject(error);
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -5179,6 +5281,192 @@ function doUserEmailNew(email) {
|
|||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserCheckIfEmailExists(email) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_STARTED"],
|
||||
email: email
|
||||
});
|
||||
|
||||
var success = function success(response) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_SUCCESS"],
|
||||
data: {
|
||||
email: email
|
||||
}
|
||||
});
|
||||
|
||||
if (response.has_password) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_EXISTS"]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var failure = function failure(error) {
|
||||
return dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'exists', {
|
||||
email: email
|
||||
}, 'post')["catch"](function (error) {
|
||||
if (error.response && error.response.status === 404) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_DOES_NOT_EXIST"]
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserSignIn(email, password) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_STARTED"],
|
||||
email: email
|
||||
});
|
||||
|
||||
var success = function success() {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_SUCCESS"],
|
||||
data: {
|
||||
email: email
|
||||
}
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
var failure = function failure(error) {
|
||||
return dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'signin', _objectSpread({
|
||||
email: email
|
||||
}, password ? {
|
||||
password: password
|
||||
} : {}), 'post')["catch"](function (error) {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_EXISTS"]
|
||||
});
|
||||
return lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_email', 'resend_token', {
|
||||
email: email,
|
||||
only_if_expired: true
|
||||
}, 'post').then(success, failure);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserSignUp(email, password) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_STARTED"],
|
||||
email: email
|
||||
});
|
||||
|
||||
var success = function success() {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_SUCCESS"],
|
||||
data: {
|
||||
email: email
|
||||
}
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
var failure = function failure(error) {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_EXISTS"]
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'signup', _objectSpread({
|
||||
email: email
|
||||
}, password ? {
|
||||
password: password
|
||||
} : {}), 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserPasswordReset(email) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_RESET_STARTED"],
|
||||
email: email
|
||||
});
|
||||
|
||||
var success = function success() {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_RESET_SUCCESS"]
|
||||
});
|
||||
};
|
||||
|
||||
var failure = function failure(error) {
|
||||
return dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_RESET_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_password', 'reset', {
|
||||
email: email
|
||||
}, 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserPasswordSet(newPassword, oldPassword, authToken) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_SET_STARTED"]
|
||||
});
|
||||
|
||||
var success = function success() {
|
||||
dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_SET_SUCCESS"]
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
var failure = function failure(error) {
|
||||
return dispatch({
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_SET_FAILURE"],
|
||||
data: {
|
||||
error: error
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_password', 'set', _objectSpread({
|
||||
new_password: newPassword
|
||||
}, oldPassword ? {
|
||||
old_password: oldPassword
|
||||
} : {}, authToken ? {
|
||||
auth_token: authToken
|
||||
} : {}), 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
function doUserResendVerificationEmail(email) {
|
||||
return function (dispatch) {
|
||||
dispatch({
|
||||
|
@ -5209,6 +5497,16 @@ function doUserResendVerificationEmail(email) {
|
|||
}).then(success, failure);
|
||||
};
|
||||
}
|
||||
function doClearEmailEntry() {
|
||||
return {
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_CLEAR_ENTRY"]
|
||||
};
|
||||
}
|
||||
function doClearPasswordEntries() {
|
||||
return {
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PASSWORD_SET_CLEAR"]
|
||||
};
|
||||
}
|
||||
function doUserEmailVerifyFailure(error) {
|
||||
return {
|
||||
type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_FAILURE"],
|
||||
|
@ -6879,7 +7177,14 @@ var defaultState = {
|
|||
emailNewErrorMessage: '',
|
||||
emailToVerify: '',
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
resendingVerificationEmail: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: false,
|
||||
passwordResetError: undefined,
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: false,
|
||||
passwordSetError: undefined,
|
||||
inviteNewErrorMessage: '',
|
||||
inviteNewIsPending: false,
|
||||
inviteStatusIsPending: false,
|
||||
|
@ -6997,7 +7302,8 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_STA
|
|||
return Object.assign({}, state, {
|
||||
emailNewIsPending: true,
|
||||
emailNewErrorMessage: '',
|
||||
emailAlreadyExists: false
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -7017,6 +7323,12 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_EXI
|
|||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_DOES_NOT_EXIST"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
emailDoesNotExist: true
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_FAILURE"]] = function (state, action) {
|
||||
return Object.assign({}, state, {
|
||||
emailNewIsPending: false,
|
||||
|
@ -7024,6 +7336,24 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_FAI
|
|||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_CLEAR_ENTRY"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
emailNewErrorMessage: null,
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
passwordExistsForUser: false,
|
||||
emailToVerify: null
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_SET_CLEAR"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordResetSuccess: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetError: null
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_VERIFY_STARTED"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
emailVerifyIsPending: true,
|
||||
|
@ -7203,6 +7533,55 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_SET_REFERRER_
|
|||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_EXISTS"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordExistsForUser: true
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_RESET_STARTED"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordResetPending: true,
|
||||
passwordResetSuccess: defaultState.passwordResetSuccess,
|
||||
passwordResetError: null
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_RESET_SUCCESS"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: true
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_RESET_FAILURE"]] = function (state, action) {
|
||||
return Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetError: action.data.error
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_SET_STARTED"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordSetPending: true,
|
||||
passwordSetSuccess: defaultState.passwordSetSuccess
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_SET_SUCCESS"]] = function (state) {
|
||||
return Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: true
|
||||
});
|
||||
};
|
||||
|
||||
reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PASSWORD_SET_FAILURE"]] = function (state, action) {
|
||||
return Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetError: action.data.error
|
||||
});
|
||||
};
|
||||
|
||||
function userReducer() {
|
||||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
|
||||
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
|
1
dist/flow-typed/User.js
vendored
1
dist/flow-typed/User.js
vendored
|
@ -16,6 +16,7 @@ declare type User = {
|
|||
is_email_enabled: boolean,
|
||||
is_identity_verified: boolean,
|
||||
is_reward_approved: boolean,
|
||||
password_set: boolean,
|
||||
language: string,
|
||||
manual_approval_user_id: ?number,
|
||||
primary_email: string,
|
||||
|
|
1
flow-typed/User.js
vendored
1
flow-typed/User.js
vendored
|
@ -16,6 +16,7 @@ declare type User = {
|
|||
is_email_enabled: boolean,
|
||||
is_identity_verified: boolean,
|
||||
is_reward_approved: boolean,
|
||||
password_set: boolean,
|
||||
language: string,
|
||||
manual_approval_user_id: ?number,
|
||||
primary_email: string,
|
||||
|
|
|
@ -9,7 +9,9 @@ export const USER_EMAIL_DECLINE = 'USER_EMAIL_DECLINE';
|
|||
export const USER_EMAIL_NEW_STARTED = 'USER_EMAIL_NEW_STARTED';
|
||||
export const USER_EMAIL_NEW_SUCCESS = 'USER_EMAIL_NEW_SUCCESS';
|
||||
export const USER_EMAIL_NEW_EXISTS = 'USER_EMAIL_NEW_EXISTS';
|
||||
export const USER_EMAIL_NEW_DOES_NOT_EXIST = 'USER_EMAIL_NEW_DOES_NOT_EXIST';
|
||||
export const USER_EMAIL_NEW_FAILURE = 'USER_EMAIL_NEW_FAILURE';
|
||||
export const USER_EMAIL_NEW_CLEAR_ENTRY = 'USER_EMAIL_NEW_CLEAR_ENTRY';
|
||||
export const USER_EMAIL_VERIFY_SET = 'USER_EMAIL_VERIFY_SET';
|
||||
export const USER_EMAIL_VERIFY_STARTED = 'USER_EMAIL_VERIFY_STARTED';
|
||||
export const USER_EMAIL_VERIFY_SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS';
|
||||
|
@ -17,6 +19,14 @@ export const USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE';
|
|||
export const USER_EMAIL_VERIFY_RETRY_STARTED = 'USER_EMAIL_VERIFY_RETRY_STARTED';
|
||||
export const USER_EMAIL_VERIFY_RETRY_FAILURE = 'USER_EMAIL_VERIFY_RETRY_FAILURE';
|
||||
export const USER_EMAIL_VERIFY_RETRY_SUCCESS = 'USER_EMAIL_VERIFY_RETRY_SUCCESS';
|
||||
export const USER_PASSWORD_EXISTS = 'USER_PASSWORD_EXISTS';
|
||||
export const USER_PASSWORD_RESET_STARTED = 'USER_PASSWORD_RESET_STARTED';
|
||||
export const USER_PASSWORD_RESET_SUCCESS = 'USER_PASSWORD_RESET_SUCCESS';
|
||||
export const USER_PASSWORD_RESET_FAILURE = 'USER_PASSWORD_RESET_FAILURE';
|
||||
export const USER_PASSWORD_SET_STARTED = 'USER_PASSWORD_SET_STARTED';
|
||||
export const USER_PASSWORD_SET_SUCCESS = 'USER_PASSWORD_SET_SUCCESS';
|
||||
export const USER_PASSWORD_SET_FAILURE = 'USER_PASSWORD_SET_FAILURE';
|
||||
export const USER_PASSWORD_SET_CLEAR = 'USER_PASSWORD_SET_CLEAR';
|
||||
export const USER_PHONE_RESET = 'USER_PHONE_RESET';
|
||||
export const USER_PHONE_NEW_STARTED = 'USER_PHONE_NEW_STARTED';
|
||||
export const USER_PHONE_NEW_SUCCESS = 'USER_PHONE_NEW_SUCCESS';
|
||||
|
|
15
src/index.js
15
src/index.js
|
@ -50,6 +50,8 @@ export {
|
|||
doInstallNewWithParams,
|
||||
doAuthenticate,
|
||||
doUserFetch,
|
||||
doUserSignIn,
|
||||
doUserSignUp,
|
||||
doUserEmailNew,
|
||||
doUserCheckEmailVerified,
|
||||
doUserEmailToVerify,
|
||||
|
@ -67,6 +69,11 @@ export {
|
|||
doCheckYoutubeTransfer,
|
||||
doUserSetReferrer,
|
||||
doUserSetReferrerReset,
|
||||
doUserPasswordReset,
|
||||
doUserPasswordSet,
|
||||
doUserCheckIfEmailExists,
|
||||
doClearEmailEntry,
|
||||
doClearPasswordEntries,
|
||||
} from 'redux/actions/user';
|
||||
export { doFetchCostInfoForUri } from 'redux/actions/cost_info';
|
||||
export { doBlackListedOutpointsSubscribe } from 'redux/actions/blacklist';
|
||||
|
@ -153,6 +160,7 @@ export {
|
|||
selectEmailVerifyIsPending,
|
||||
selectEmailVerifyErrorMessage,
|
||||
selectEmailAlreadyExists,
|
||||
selectEmailDoesNotExist,
|
||||
selectResendingVerificationEmail,
|
||||
selectPhoneVerifyErrorMessage,
|
||||
selectPhoneVerifyIsPending,
|
||||
|
@ -175,6 +183,13 @@ export {
|
|||
selectYouTubeImportVideosComplete,
|
||||
selectSetReferrerPending,
|
||||
selectSetReferrerError,
|
||||
selectPasswordResetIsPending,
|
||||
selectPasswordResetSuccess,
|
||||
selectPasswordResetError,
|
||||
selectPasswordSetIsPending,
|
||||
selectPasswordSetSuccess,
|
||||
selectPasswordSetError,
|
||||
selectPasswordExists,
|
||||
} from 'redux/selectors/user';
|
||||
export {
|
||||
makeSelectFetchingCostInfoForUri,
|
||||
|
|
|
@ -81,7 +81,7 @@ export function doInstallNewWithParams(
|
|||
platform,
|
||||
firebaseToken = null
|
||||
) {
|
||||
return dispatch => {
|
||||
return () => {
|
||||
const payload = { app_version: appVersion };
|
||||
if (firebaseToken) {
|
||||
payload.firebase_token = firebaseToken;
|
||||
|
@ -137,25 +137,29 @@ export function doAuthenticate(
|
|||
}
|
||||
|
||||
export function doUserFetch() {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_STARTED,
|
||||
});
|
||||
Lbryio.getCurrentUser()
|
||||
.then(user => {
|
||||
dispatch(doRewardList());
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_SUCCESS,
|
||||
data: { user },
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
return dispatch =>
|
||||
new Promise((resolve, reject) => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_STARTED,
|
||||
});
|
||||
};
|
||||
|
||||
Lbryio.getCurrentUser()
|
||||
.then(user => {
|
||||
dispatch(doRewardList());
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_SUCCESS,
|
||||
data: { user },
|
||||
});
|
||||
resolve(user);
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
dispatch({
|
||||
type: ACTIONS.USER_FETCH_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function doUserCheckEmailVerified() {
|
||||
|
@ -301,6 +305,175 @@ export function doUserEmailNew(email) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doUserCheckIfEmailExists(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_STARTED,
|
||||
email,
|
||||
});
|
||||
|
||||
const success = response => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_SUCCESS,
|
||||
data: { email },
|
||||
});
|
||||
|
||||
if (response.has_password) {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_EXISTS,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const failure = error =>
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
|
||||
Lbryio.call('user', 'exists', { email }, 'post')
|
||||
.catch(error => {
|
||||
if (error.response && error.response.status === 404) {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_DOES_NOT_EXIST,
|
||||
});
|
||||
}
|
||||
throw error;
|
||||
})
|
||||
.then(success, failure);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserSignIn(email, password) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_STARTED,
|
||||
email,
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_SUCCESS,
|
||||
data: { email },
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error =>
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
|
||||
Lbryio.call('user', 'signin', { email, ...(password ? { password } : {}) }, 'post')
|
||||
.catch(error => {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_EXISTS,
|
||||
});
|
||||
|
||||
return Lbryio.call(
|
||||
'user_email',
|
||||
'resend_token',
|
||||
{ email, only_if_expired: true },
|
||||
'post'
|
||||
).then(success, failure);
|
||||
}
|
||||
throw error;
|
||||
})
|
||||
.then(success, failure);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserSignUp(email, password) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_STARTED,
|
||||
email,
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_SUCCESS,
|
||||
data: { email },
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error => {
|
||||
if (error.response && error.response.status === 409) {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_EXISTS,
|
||||
});
|
||||
}
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
};
|
||||
|
||||
Lbryio.call('user', 'signup', { email, ...(password ? { password } : {}) }, 'post').then(
|
||||
success,
|
||||
failure
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserPasswordReset(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_RESET_STARTED,
|
||||
email,
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_RESET_SUCCESS,
|
||||
});
|
||||
};
|
||||
|
||||
const failure = error =>
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_RESET_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
|
||||
Lbryio.call('user_password', 'reset', { email }, 'post').then(success, failure);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserPasswordSet(newPassword, oldPassword, authToken) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_SET_STARTED,
|
||||
});
|
||||
|
||||
const success = () => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_SET_SUCCESS,
|
||||
});
|
||||
dispatch(doUserFetch());
|
||||
};
|
||||
|
||||
const failure = error =>
|
||||
dispatch({
|
||||
type: ACTIONS.USER_PASSWORD_SET_FAILURE,
|
||||
data: { error },
|
||||
});
|
||||
|
||||
Lbryio.call(
|
||||
'user_password',
|
||||
'set',
|
||||
{
|
||||
new_password: newPassword,
|
||||
...(oldPassword ? { old_password: oldPassword } : {}),
|
||||
...(authToken ? { auth_token: authToken } : {}),
|
||||
},
|
||||
'post'
|
||||
).then(success, failure);
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserResendVerificationEmail(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
|
@ -330,6 +503,18 @@ export function doUserResendVerificationEmail(email) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doClearEmailEntry() {
|
||||
return {
|
||||
type: ACTIONS.USER_EMAIL_NEW_CLEAR_ENTRY,
|
||||
};
|
||||
}
|
||||
|
||||
export function doClearPasswordEntries() {
|
||||
return {
|
||||
type: ACTIONS.USER_PASSWORD_SET_CLEAR,
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserEmailVerifyFailure(error) {
|
||||
return {
|
||||
type: ACTIONS.USER_EMAIL_VERIFY_FAILURE,
|
||||
|
|
|
@ -9,7 +9,14 @@ const defaultState = {
|
|||
emailNewErrorMessage: '',
|
||||
emailToVerify: '',
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
resendingVerificationEmail: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: false,
|
||||
passwordResetError: undefined,
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: false,
|
||||
passwordSetError: undefined,
|
||||
inviteNewErrorMessage: '',
|
||||
inviteNewIsPending: false,
|
||||
inviteStatusIsPending: false,
|
||||
|
@ -116,6 +123,7 @@ reducers[ACTIONS.USER_EMAIL_NEW_STARTED] = state =>
|
|||
emailNewIsPending: true,
|
||||
emailNewErrorMessage: '',
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_SUCCESS] = (state, action) => {
|
||||
|
@ -133,12 +141,33 @@ reducers[ACTIONS.USER_EMAIL_NEW_EXISTS] = state =>
|
|||
emailAlreadyExists: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_DOES_NOT_EXIST] = state =>
|
||||
Object.assign({}, state, {
|
||||
emailDoesNotExist: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_FAILURE] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
emailNewIsPending: false,
|
||||
emailNewErrorMessage: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_NEW_CLEAR_ENTRY] = state =>
|
||||
Object.assign({}, state, {
|
||||
emailNewErrorMessage: null,
|
||||
emailAlreadyExists: false,
|
||||
emailDoesNotExist: false,
|
||||
passwordExistsForUser: false,
|
||||
emailToVerify: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_CLEAR] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetSuccess: false,
|
||||
passwordResetPending: false,
|
||||
passwordResetError: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_EMAIL_VERIFY_STARTED] = state =>
|
||||
Object.assign({}, state, {
|
||||
emailVerifyIsPending: true,
|
||||
|
@ -296,6 +325,48 @@ reducers[ACTIONS.USER_SET_REFERRER_RESET] = state =>
|
|||
referrerSetError: defaultState.referrerSetError,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_EXISTS] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordExistsForUser: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_STARTED] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetPending: true,
|
||||
passwordResetSuccess: defaultState.passwordResetSuccess,
|
||||
passwordResetError: null,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_SUCCESS] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetSuccess: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_RESET_FAILURE] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
passwordResetPending: false,
|
||||
passwordResetError: action.data.error,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_STARTED] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordSetPending: true,
|
||||
passwordSetSuccess: defaultState.passwordSetSuccess,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_SUCCESS] = state =>
|
||||
Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetSuccess: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.USER_PASSWORD_SET_FAILURE] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
passwordSetPending: false,
|
||||
passwordSetError: action.data.error,
|
||||
});
|
||||
|
||||
export function userReducer(state = defaultState, action) {
|
||||
const handler = reducers[action.type];
|
||||
if (handler) return handler(state, action);
|
||||
|
|
|
@ -16,6 +16,11 @@ export const selectEmailAlreadyExists = createSelector(
|
|||
state => state.emailAlreadyExists
|
||||
);
|
||||
|
||||
export const selectEmailDoesNotExist = createSelector(
|
||||
selectState,
|
||||
state => state.emailDoesNotExist
|
||||
);
|
||||
|
||||
export const selectResendingVerificationEmail = createSelector(
|
||||
selectState,
|
||||
state => state.resendingVerificationEmail
|
||||
|
@ -63,11 +68,46 @@ export const selectEmailNewIsPending = createSelector(
|
|||
state => state.emailNewIsPending
|
||||
);
|
||||
|
||||
export const selectEmailNewErrorMessage = createSelector(
|
||||
export const selectEmailNewErrorMessage = createSelector(selectState, state => {
|
||||
const error = state.emailNewErrorMessage;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
|
||||
export const selectPasswordExists = createSelector(
|
||||
selectState,
|
||||
state => state.emailNewErrorMessage
|
||||
state => state.passwordExistsForUser
|
||||
);
|
||||
|
||||
export const selectPasswordResetIsPending = createSelector(
|
||||
selectState,
|
||||
state => state.passwordResetPending
|
||||
);
|
||||
|
||||
export const selectPasswordResetSuccess = createSelector(
|
||||
selectState,
|
||||
state => state.passwordResetSuccess
|
||||
);
|
||||
|
||||
export const selectPasswordResetError = createSelector(selectState, state => {
|
||||
const error = state.passwordResetError;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
|
||||
export const selectPasswordSetIsPending = createSelector(
|
||||
selectState,
|
||||
state => state.passwordSetPending
|
||||
);
|
||||
|
||||
export const selectPasswordSetSuccess = createSelector(
|
||||
selectState,
|
||||
state => state.passwordSetSuccess
|
||||
);
|
||||
|
||||
export const selectPasswordSetError = createSelector(selectState, state => {
|
||||
const error = state.passwordSetError;
|
||||
return typeof error === 'object' && error !== null ? error.message : error;
|
||||
});
|
||||
|
||||
export const selectPhoneNewErrorMessage = createSelector(
|
||||
selectState,
|
||||
state => state.phoneNewErrorMessage
|
||||
|
|
Loading…
Add table
Reference in a new issue