From 7c94a38683344262fe34773dc50bfbe6d2a9e116 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 2 Oct 2019 00:15:24 -0400 Subject: [PATCH 1/5] changes for youtube sync onboarding --- .eslintrc.json | 1 + dist/bundle.es.js | 464 +++++++++----- dist/bundle.js | 1120 +++++++++++++++++++-------------- src/constants/action_types.js | 39 +- src/constants/youtube.js | 3 + src/index.js | 10 +- src/redux/actions/sync.js | 126 ++-- src/redux/actions/user.js | 43 +- src/redux/reducers/sync.js | 8 + src/redux/reducers/user.js | 29 +- src/redux/selectors/sync.js | 5 + src/redux/selectors/user.js | 17 +- 12 files changed, 1159 insertions(+), 706 deletions(-) create mode 100644 src/constants/youtube.js diff --git a/.eslintrc.json b/.eslintrc.json index 71fe382..6791352 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,6 +22,7 @@ "__": true }, "rules": { + "consistent-return": 0, "import/no-commonjs": "warn", "import/no-amd": "warn", "import/prefer-default-export": "ignore", diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 36c9669..ab72001 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -8,10 +8,46 @@ var lbryRedux = require('lbry-redux'); var querystring = _interopDefault(require('querystring')); var reselect = require('reselect'); -// Auth Token +// User const GENERATE_AUTH_TOKEN_FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE'; const GENERATE_AUTH_TOKEN_STARTED = 'GENERATE_AUTH_TOKEN_STARTED'; -const GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS'; // Claims +const GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS'; +const AUTHENTICATION_STARTED = 'AUTHENTICATION_STARTED'; +const AUTHENTICATION_SUCCESS = 'AUTHENTICATION_SUCCESS'; +const AUTHENTICATION_FAILURE = 'AUTHENTICATION_FAILURE'; +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_FAILURE = 'USER_EMAIL_NEW_FAILURE'; +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'; +const USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE'; +const USER_EMAIL_VERIFY_RETRY = 'USER_EMAIL_VERIFY_RETRY'; +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'; +const USER_PHONE_NEW_FAILURE = 'USER_PHONE_NEW_FAILURE'; +const USER_PHONE_VERIFY_STARTED = 'USER_PHONE_VERIFY_STARTED'; +const USER_PHONE_VERIFY_SUCCESS = 'USER_PHONE_VERIFY_SUCCESS'; +const USER_PHONE_VERIFY_FAILURE = 'USER_PHONE_VERIFY_FAILURE'; +const USER_IDENTITY_VERIFY_STARTED = 'USER_IDENTITY_VERIFY_STARTED'; +const USER_IDENTITY_VERIFY_SUCCESS = 'USER_IDENTITY_VERIFY_SUCCESS'; +const USER_IDENTITY_VERIFY_FAILURE = 'USER_IDENTITY_VERIFY_FAILURE'; +const USER_FETCH_STARTED = 'USER_FETCH_STARTED'; +const USER_FETCH_SUCCESS = 'USER_FETCH_SUCCESS'; +const USER_FETCH_FAILURE = 'USER_FETCH_FAILURE'; +const USER_INVITE_STATUS_FETCH_STARTED = 'USER_INVITE_STATUS_FETCH_STARTED'; +const USER_INVITE_STATUS_FETCH_SUCCESS = 'USER_INVITE_STATUS_FETCH_SUCCESS'; +const USER_INVITE_STATUS_FETCH_FAILURE = 'USER_INVITE_STATUS_FETCH_FAILURE'; +const USER_INVITE_NEW_STARTED = 'USER_INVITE_NEW_STARTED'; +const USER_INVITE_NEW_SUCCESS = 'USER_INVITE_NEW_SUCCESS'; +const USER_INVITE_NEW_FAILURE = 'USER_INVITE_NEW_FAILURE'; +const FETCH_ACCESS_TOKEN_SUCCESS = 'FETCH_ACCESS_TOKEN_SUCCESS'; +const USER_YOUTUBE_IMPORT_STARTED = 'USER_YOUTUBE_IMPORT_STARTED'; +const USER_YOUTUBE_IMPORT_FAILURE = 'USER_YOUTUBE_IMPORT_FAILURE'; +const USER_YOUTUBE_IMPORT_SUCCESS = 'USER_YOUTUBE_IMPORT_SUCCESS'; // Claims const FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED'; const FETCH_FEATURED_CONTENT_COMPLETED = 'FETCH_FEATURED_CONTENT_COMPLETED'; @@ -83,6 +119,7 @@ const FETCH_SUB_COUNT_COMPLETED = 'FETCH_SUB_COUNT_COMPLETED'; // Cross-device S const GET_SYNC_STARTED = 'GET_SYNC_STARTED'; const GET_SYNC_COMPLETED = 'GET_SYNC_COMPLETED'; +const GET_SYNC_FAILED = 'GET_SYNC_FAILED'; const SET_SYNC_STARTED = 'SET_SYNC_STARTED'; const SET_SYNC_FAILED = 'SET_SYNC_FAILED'; const SET_SYNC_COMPLETED = 'SET_SYNC_COMPLETED'; @@ -95,6 +132,42 @@ var action_types = /*#__PURE__*/Object.freeze({ GENERATE_AUTH_TOKEN_FAILURE: GENERATE_AUTH_TOKEN_FAILURE, GENERATE_AUTH_TOKEN_STARTED: GENERATE_AUTH_TOKEN_STARTED, GENERATE_AUTH_TOKEN_SUCCESS: GENERATE_AUTH_TOKEN_SUCCESS, + AUTHENTICATION_STARTED: AUTHENTICATION_STARTED, + AUTHENTICATION_SUCCESS: AUTHENTICATION_SUCCESS, + AUTHENTICATION_FAILURE: AUTHENTICATION_FAILURE, + USER_EMAIL_DECLINE: USER_EMAIL_DECLINE, + 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_FAILURE: USER_EMAIL_NEW_FAILURE, + USER_EMAIL_VERIFY_SET: USER_EMAIL_VERIFY_SET, + USER_EMAIL_VERIFY_STARTED: USER_EMAIL_VERIFY_STARTED, + USER_EMAIL_VERIFY_SUCCESS: USER_EMAIL_VERIFY_SUCCESS, + USER_EMAIL_VERIFY_FAILURE: USER_EMAIL_VERIFY_FAILURE, + USER_EMAIL_VERIFY_RETRY: USER_EMAIL_VERIFY_RETRY, + USER_PHONE_RESET: USER_PHONE_RESET, + USER_PHONE_NEW_STARTED: USER_PHONE_NEW_STARTED, + USER_PHONE_NEW_SUCCESS: USER_PHONE_NEW_SUCCESS, + USER_PHONE_NEW_FAILURE: USER_PHONE_NEW_FAILURE, + USER_PHONE_VERIFY_STARTED: USER_PHONE_VERIFY_STARTED, + USER_PHONE_VERIFY_SUCCESS: USER_PHONE_VERIFY_SUCCESS, + USER_PHONE_VERIFY_FAILURE: USER_PHONE_VERIFY_FAILURE, + USER_IDENTITY_VERIFY_STARTED: USER_IDENTITY_VERIFY_STARTED, + USER_IDENTITY_VERIFY_SUCCESS: USER_IDENTITY_VERIFY_SUCCESS, + USER_IDENTITY_VERIFY_FAILURE: USER_IDENTITY_VERIFY_FAILURE, + USER_FETCH_STARTED: USER_FETCH_STARTED, + USER_FETCH_SUCCESS: USER_FETCH_SUCCESS, + USER_FETCH_FAILURE: USER_FETCH_FAILURE, + USER_INVITE_STATUS_FETCH_STARTED: USER_INVITE_STATUS_FETCH_STARTED, + USER_INVITE_STATUS_FETCH_SUCCESS: USER_INVITE_STATUS_FETCH_SUCCESS, + USER_INVITE_STATUS_FETCH_FAILURE: USER_INVITE_STATUS_FETCH_FAILURE, + USER_INVITE_NEW_STARTED: USER_INVITE_NEW_STARTED, + USER_INVITE_NEW_SUCCESS: USER_INVITE_NEW_SUCCESS, + USER_INVITE_NEW_FAILURE: USER_INVITE_NEW_FAILURE, + FETCH_ACCESS_TOKEN_SUCCESS: FETCH_ACCESS_TOKEN_SUCCESS, + USER_YOUTUBE_IMPORT_STARTED: USER_YOUTUBE_IMPORT_STARTED, + USER_YOUTUBE_IMPORT_FAILURE: USER_YOUTUBE_IMPORT_FAILURE, + USER_YOUTUBE_IMPORT_SUCCESS: USER_YOUTUBE_IMPORT_SUCCESS, FETCH_FEATURED_CONTENT_STARTED: FETCH_FEATURED_CONTENT_STARTED, FETCH_FEATURED_CONTENT_COMPLETED: FETCH_FEATURED_CONTENT_COMPLETED, FETCH_TRENDING_CONTENT_STARTED: FETCH_TRENDING_CONTENT_STARTED, @@ -159,6 +232,7 @@ var action_types = /*#__PURE__*/Object.freeze({ FETCH_SUB_COUNT_COMPLETED: FETCH_SUB_COUNT_COMPLETED, GET_SYNC_STARTED: GET_SYNC_STARTED, GET_SYNC_COMPLETED: GET_SYNC_COMPLETED, + GET_SYNC_FAILED: GET_SYNC_FAILED, SET_SYNC_STARTED: SET_SYNC_STARTED, SET_SYNC_FAILED: SET_SYNC_FAILED, SET_SYNC_COMPLETED: SET_SYNC_COMPLETED, @@ -168,6 +242,16 @@ var action_types = /*#__PURE__*/Object.freeze({ SYNC_APPLY_FAILED: SYNC_APPLY_FAILED }); +const NOT_TRANSFERRED = 'not_transferred'; +const PENDING_TRANSFER = 'pending_transfer'; +const COMPLETED_TRANSFER = 'completed_transfer'; + +var youtube = /*#__PURE__*/Object.freeze({ + NOT_TRANSFERRED: NOT_TRANSFERRED, + PENDING_TRANSFER: PENDING_TRANSFER, + COMPLETED_TRANSFER: COMPLETED_TRANSFER +}); + const Lbryio = { enabled: true, authenticationPromise: null, @@ -1040,18 +1124,26 @@ const selectUserInviteStatusFailed = reselect.createSelector(selectUserInvitesRe const selectUserInviteNewIsPending = reselect.createSelector(selectState$2, state => state.inviteNewIsPending); const selectUserInviteNewErrorMessage = reselect.createSelector(selectState$2, state => state.inviteNewErrorMessage); const selectUserInviteReferralLink = reselect.createSelector(selectState$2, state => state.referralLink); -const selectYTImportPending = reselect.createSelector(selectState$2, state => state.ytChannelImportPending); -const selectYTImportError = reselect.createSelector(selectState$2, state => state.ytChannelImportErrorMessage); +const selectYouTubeImportPending = reselect.createSelector(selectState$2, state => state.youtubeChannelImportPending); +const selectYouTubeImportError = reselect.createSelector(selectState$2, state => state.youtubeChannelImportErrorMessage); +const selectYouTubeImportVideosComplete = reselect.createSelector(selectState$2, state => { + const total = state.youtubeChannelImportTotal; + const complete = state.youtubeChannelImportComplete || 0; + + if (total) { + return [complete, total]; + } +}); function doFetchInviteStatus() { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_STARTED + type: USER_INVITE_STATUS_FETCH_STARTED }); Promise.all([Lbryio.call('user', 'invite_status'), Lbryio.call('user_referral_code', 'list')]).then(([status, code]) => { dispatch(doRewardList()); dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_SUCCESS, + type: USER_INVITE_STATUS_FETCH_SUCCESS, data: { invitesRemaining: status.invites_remaining ? status.invites_remaining : 0, invitees: status.invitees, @@ -1060,7 +1152,7 @@ function doFetchInviteStatus() { }); }).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_FAILURE, + type: USER_INVITE_STATUS_FETCH_FAILURE, data: { error } @@ -1087,12 +1179,12 @@ function doInstallNew(appVersion, os = null) { function doAuthenticate(appVersion, os = null) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.AUTHENTICATION_STARTED + type: AUTHENTICATION_STARTED }); Lbryio.authenticate().then(user => { // analytics.setUser(user); dispatch({ - type: lbryRedux.ACTIONS.AUTHENTICATION_SUCCESS, + type: AUTHENTICATION_SUCCESS, data: { user } @@ -1102,7 +1194,7 @@ function doAuthenticate(appVersion, os = null) { doInstallNew(appVersion, os); }).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.AUTHENTICATION_FAILURE, + type: AUTHENTICATION_FAILURE, data: { error } @@ -1113,20 +1205,19 @@ function doAuthenticate(appVersion, os = null) { function doUserFetch() { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_FETCH_STARTED + type: USER_FETCH_STARTED }); Lbryio.getCurrentUser().then(user => { - // analytics.setUser(user); dispatch(doRewardList()); dispatch({ - type: lbryRedux.ACTIONS.USER_FETCH_SUCCESS, + type: USER_FETCH_SUCCESS, data: { user } }); }).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.USER_FETCH_FAILURE, + type: USER_FETCH_FAILURE, data: { error } @@ -1141,7 +1232,7 @@ function doUserCheckEmailVerified() { if (user.has_verified_email) { dispatch(doRewardList()); dispatch({ - type: lbryRedux.ACTIONS.USER_FETCH_SUCCESS, + type: USER_FETCH_SUCCESS, data: { user } @@ -1152,13 +1243,13 @@ function doUserCheckEmailVerified() { } function doUserPhoneReset() { return { - type: lbryRedux.ACTIONS.USER_PHONE_RESET + type: USER_PHONE_RESET }; } function doUserPhoneNew(phone, countryCode) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_PHONE_NEW_STARTED, + type: USER_PHONE_NEW_STARTED, data: { phone, country_code: countryCode @@ -1167,7 +1258,7 @@ function doUserPhoneNew(phone, countryCode) { const success = () => { dispatch({ - type: lbryRedux.ACTIONS.USER_PHONE_NEW_SUCCESS, + type: USER_PHONE_NEW_SUCCESS, data: { phone } @@ -1176,7 +1267,7 @@ function doUserPhoneNew(phone, countryCode) { const failure = error => { dispatch({ - type: lbryRedux.ACTIONS.USER_PHONE_NEW_FAILURE, + type: USER_PHONE_NEW_FAILURE, data: { error } @@ -1191,7 +1282,7 @@ function doUserPhoneNew(phone, countryCode) { } function doUserPhoneVerifyFailure(error) { return { - type: lbryRedux.ACTIONS.USER_PHONE_VERIFY_FAILURE, + type: USER_PHONE_VERIFY_FAILURE, data: { error } @@ -1202,7 +1293,7 @@ function doUserPhoneVerify(verificationCode) { const phoneNumber = selectPhoneToVerify(getState()); const countryCode = selectUserCountryCode(getState()); dispatch({ - type: lbryRedux.ACTIONS.USER_PHONE_VERIFY_STARTED, + type: USER_PHONE_VERIFY_STARTED, code: verificationCode }); Lbryio.call('user', 'phone_number_confirm', { @@ -1212,7 +1303,7 @@ function doUserPhoneVerify(verificationCode) { }, 'post').then(user => { if (user.is_identity_verified) { dispatch({ - type: lbryRedux.ACTIONS.USER_PHONE_VERIFY_SUCCESS, + type: USER_PHONE_VERIFY_SUCCESS, data: { user } @@ -1225,7 +1316,7 @@ function doUserPhoneVerify(verificationCode) { function doUserEmailToVerify(email) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_VERIFY_SET, + type: USER_EMAIL_VERIFY_SET, data: { email } @@ -1235,13 +1326,13 @@ function doUserEmailToVerify(email) { function doUserEmailNew(email) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_NEW_STARTED, + type: USER_EMAIL_NEW_STARTED, email }); const success = () => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_NEW_SUCCESS, + type: USER_EMAIL_NEW_SUCCESS, data: { email } @@ -1251,7 +1342,7 @@ function doUserEmailNew(email) { const failure = error => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_NEW_FAILURE, + type: USER_EMAIL_NEW_FAILURE, data: { error } @@ -1276,13 +1367,13 @@ function doUserEmailNew(email) { function doUserResendVerificationEmail(email) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_VERIFY_RETRY, + type: USER_EMAIL_VERIFY_RETRY, email }); const success = () => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_NEW_SUCCESS, + type: USER_EMAIL_NEW_SUCCESS, data: { email } @@ -1292,7 +1383,7 @@ function doUserResendVerificationEmail(email) { const failure = error => { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_NEW_FAILURE, + type: USER_EMAIL_NEW_FAILURE, data: { error } @@ -1310,7 +1401,7 @@ function doUserResendVerificationEmail(email) { } function doUserEmailVerifyFailure(error) { return { - type: lbryRedux.ACTIONS.USER_EMAIL_VERIFY_FAILURE, + type: USER_EMAIL_VERIFY_FAILURE, data: { error } @@ -1320,7 +1411,7 @@ function doUserEmailVerify(verificationToken, recaptcha) { return (dispatch, getState) => { const email = selectEmailToVerify(getState()); dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_VERIFY_STARTED, + type: USER_EMAIL_VERIFY_STARTED, code: verificationToken, recaptcha }); @@ -1331,7 +1422,7 @@ function doUserEmailVerify(verificationToken, recaptcha) { }, 'post').then(userEmail => { if (userEmail.is_verified) { dispatch({ - type: lbryRedux.ACTIONS.USER_EMAIL_VERIFY_SUCCESS, + type: USER_EMAIL_VERIFY_SUCCESS, data: { email } @@ -1346,7 +1437,7 @@ function doUserEmailVerify(verificationToken, recaptcha) { function doFetchAccessToken() { return dispatch => { const success = token => dispatch({ - type: lbryRedux.ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS, + type: FETCH_ACCESS_TOKEN_SUCCESS, data: { token } @@ -1358,7 +1449,7 @@ function doFetchAccessToken() { function doUserIdentityVerify(stripeToken) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_STARTED, + type: USER_IDENTITY_VERIFY_STARTED, token: stripeToken }); Lbryio.call('user', 'verify_identity', { @@ -1366,7 +1457,7 @@ function doUserIdentityVerify(stripeToken) { }, 'post').then(user => { if (user.is_identity_verified) { dispatch({ - type: lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_SUCCESS, + type: USER_IDENTITY_VERIFY_SUCCESS, data: { user } @@ -1377,7 +1468,7 @@ function doUserIdentityVerify(stripeToken) { } }).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_FAILURE, + type: USER_IDENTITY_VERIFY_FAILURE, data: { error: error.toString() } @@ -1388,13 +1479,13 @@ function doUserIdentityVerify(stripeToken) { function doUserInviteNew(email) { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_NEW_STARTED + type: USER_INVITE_NEW_STARTED }); Lbryio.call('user', 'invite', { email }, 'post').then(() => { dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_NEW_SUCCESS, + type: USER_INVITE_NEW_SUCCESS, data: { email } @@ -1405,7 +1496,7 @@ function doUserInviteNew(email) { dispatch(doFetchInviteStatus()); }).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.USER_INVITE_NEW_FAILURE, + type: USER_INVITE_NEW_FAILURE, data: { error } @@ -1416,14 +1507,16 @@ function doUserInviteNew(email) { function doClaimYoutubeChannels() { return dispatch => { dispatch({ - type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_STARTED + type: USER_YOUTUBE_IMPORT_STARTED }); - lbryRedux.Lbry.address_list().then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0]).then(address => Lbryio.call('yt', 'transfer', { + let transferResponse; + return lbryRedux.Lbry.address_list().then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0]).then(address => Lbryio.call('yt', 'transfer', { address: address.address, public_key: address.pubkey }).then(response => { - if (response && response.success) { - Promise.all(response.map(channelMeta => { + if (response && response.length) { + transferResponse = response; + return Promise.all(response.map(channelMeta => { if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return lbryRedux.Lbry.channel_import({ channel_data: channelMeta.channel.channel_certificate @@ -1433,7 +1526,8 @@ function doClaimYoutubeChannels() { return null; })).then(() => { const actions = [{ - type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_COMPLETED + type: USER_YOUTUBE_IMPORT_SUCCESS, + data: transferResponse }]; actions.push(doUserFetch()); actions.push(lbryRedux.doFetchChannelListMine()); @@ -1442,7 +1536,29 @@ function doClaimYoutubeChannels() { } })).catch(error => { dispatch({ - type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_FAILURE, + type: USER_YOUTUBE_IMPORT_FAILURE, + data: String(error) + }); + }); + }; +} +function doCheckYoutubeTransfer() { + return dispatch => { + dispatch({ + type: USER_YOUTUBE_IMPORT_STARTED + }); + return Lbryio.call('yt', 'transfer').then(response => { + if (response && response.length) { + dispatch({ + type: USER_YOUTUBE_IMPORT_SUCCESS, + data: response + }); + } else { + throw new Error(); + } + }).catch(error => { + dispatch({ + type: USER_YOUTUBE_IMPORT_FAILURE, data: String(error) }); }); @@ -2203,41 +2319,6 @@ const doFetchSubCount = claimId => dispatch => { }); }; -function doSetSync(oldHash, newHash, data) { - return dispatch => { - dispatch({ - type: SET_SYNC_STARTED - }); - Lbryio.call('sync', 'set', { - old_hash: oldHash, - new_hash: newHash, - data - }, 'post').then(response => { - if (!response.hash) { - return dispatch({ - type: SET_SYNC_FAILED, - data: { - error: 'No hash returned for sync/set.' - } - }); - } - - return dispatch({ - type: SET_SYNC_COMPLETED, - data: { - syncHash: response.hash - } - }); - }).catch(error => { - dispatch({ - type: SET_SYNC_FAILED, - data: { - error - } - }); - }); - }; -} function doSetDefaultAccount(success, failure) { return dispatch => { dispatch({ @@ -2276,11 +2357,9 @@ function doSetDefaultAccount(success, failure) { failure(err); } }); - } else { + } else if (failure) { // no default account to set - if (failure) { - failure('Could not set a default account'); // fail - } + failure('Could not set a default account'); // fail } }).catch(err => { if (failure) { @@ -2289,33 +2368,83 @@ function doSetDefaultAccount(success, failure) { }); }; } -function doGetSync(password) { +function doSetSync(oldHash, newHash, data, password) { + return dispatch => { + dispatch({ + type: SET_SYNC_STARTED + }); + Lbryio.call('sync', 'set', { + old_hash: oldHash, + new_hash: newHash, + data + }, 'post').then(response => { + if (!response.hash) { + return dispatch({ + type: SET_SYNC_FAILED, + data: { + error: 'No hash returned for sync/set.' + } + }); + } + + if (oldHash && newHash !== oldHash) { + dispatch(doSetDefaultAccount(() => { + if (password !== undefined) { + lbryRedux.Lbry.account_unlock({ + password + }); + dispatch(lbryRedux.doFetchChannelListMine()); + } + })); + } + + return dispatch({ + type: SET_SYNC_COMPLETED, + data: { + syncHash: response.hash + } + }); + }).catch(error => { + dispatch({ + type: SET_SYNC_FAILED, + data: { + error + } + }); + }); + }; +} +function doGetSync(password = '') { return dispatch => { dispatch({ type: GET_SYNC_STARTED }); + const data = {}; lbryRedux.Lbry.sync_hash().then(hash => { Lbryio.call('sync', 'get', { hash }, 'post').then(response => { - const data = { - hasSyncedWallet: true - }; + const syncHash = response.hash; + data.syncHash = syncHash; + data.syncData = response.data; + data.hasSyncedWallet = true; if (response.changed) { - const syncHash = response.hash; - data.syncHash = syncHash; - data.syncData = response.data; - lbryRedux.Lbry.sync_apply({ + return lbryRedux.Lbry.sync_apply({ password, data: response.data }).then(({ hash: walletHash, data: walletData }) => { + dispatch({ + type: GET_SYNC_COMPLETED, + data + }); + if (walletHash !== syncHash) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData)); + dispatch(doSetSync(syncHash, walletHash, walletData, password)); } }); } @@ -2325,22 +2454,31 @@ function doGetSync(password) { data }); }).catch(() => { - // user doesn't have a synced wallet - dispatch({ - type: GET_SYNC_COMPLETED, - data: { - hasSyncedWallet: false, - syncHash: null - } - }); // call sync_apply to get data to sync - // first time sync. use any string for old hash + if (data.hasSyncedWallet) { + dispatch({ + type: GET_SYNC_FAILED, + data: { + error: 'Error getting synced wallet' + } + }); + } else { + // user doesn't have a synced wallet + dispatch({ + type: GET_SYNC_COMPLETED, + data: { + hasSyncedWallet: false, + syncHash: null + } + }); // call sync_apply to get data to sync + // first time sync. use any string for old hash - lbryRedux.Lbry.sync_apply({ - password - }).then(({ - hash: walletHash, - data - }) => dispatch(doSetSync('', walletHash, data))); + lbryRedux.Lbry.sync_apply({ + password + }).then(({ + hash: walletHash, + data: syncApplyData + }) => dispatch(doSetSync('', walletHash, syncApplyData, password))); + } }); }); }; @@ -2562,44 +2700,44 @@ const defaultState$3 = { invitesRemaining: undefined, invitees: undefined, user: undefined, - ytChannelImportPending: false, - ytChannelImportErrorMessage: '' + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '' }; -reducers$2[lbryRedux.ACTIONS.AUTHENTICATION_STARTED] = state => Object.assign({}, state, { +reducers$2[AUTHENTICATION_STARTED] = state => Object.assign({}, state, { authenticationIsPending: true, userIsPending: true, user: defaultState$3.user }); -reducers$2[lbryRedux.ACTIONS.AUTHENTICATION_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[AUTHENTICATION_SUCCESS] = (state, action) => Object.assign({}, state, { authenticationIsPending: false, userIsPending: false, user: action.data.user }); -reducers$2[lbryRedux.ACTIONS.AUTHENTICATION_FAILURE] = state => Object.assign({}, state, { +reducers$2[AUTHENTICATION_FAILURE] = state => Object.assign({}, state, { authenticationIsPending: false, userIsPending: false, user: null }); -reducers$2[lbryRedux.ACTIONS.USER_FETCH_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_FETCH_STARTED] = state => Object.assign({}, state, { userIsPending: true }); -reducers$2[lbryRedux.ACTIONS.USER_FETCH_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_FETCH_SUCCESS] = (state, action) => Object.assign({}, state, { userIsPending: false, user: action.data.user, emailToVerify: action.data.user.has_verified_email ? null : state.emailToVerify }); -reducers$2[lbryRedux.ACTIONS.USER_FETCH_FAILURE] = state => Object.assign({}, state, { +reducers$2[USER_FETCH_FAILURE] = state => Object.assign({}, state, { userIsPending: true, user: null }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_NEW_STARTED] = (state, action) => { +reducers$2[USER_PHONE_NEW_STARTED] = (state, action) => { const user = Object.assign({}, state.user); user.country_code = action.data.country_code; return Object.assign({}, state, { @@ -2609,42 +2747,42 @@ reducers$2[lbryRedux.ACTIONS.USER_PHONE_NEW_STARTED] = (state, action) => { }); }; -reducers$2[lbryRedux.ACTIONS.USER_PHONE_NEW_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_PHONE_NEW_SUCCESS] = (state, action) => Object.assign({}, state, { phoneToVerify: action.data.phone, phoneNewIsPending: false }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_RESET] = state => Object.assign({}, state, { +reducers$2[USER_PHONE_RESET] = state => Object.assign({}, state, { phoneToVerify: null }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_NEW_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_PHONE_NEW_FAILURE] = (state, action) => Object.assign({}, state, { phoneNewIsPending: false, phoneNewErrorMessage: action.data.error }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_VERIFY_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_PHONE_VERIFY_STARTED] = state => Object.assign({}, state, { phoneVerifyIsPending: true, phoneVerifyErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_VERIFY_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_PHONE_VERIFY_SUCCESS] = (state, action) => Object.assign({}, state, { phoneToVerify: '', phoneVerifyIsPending: false, user: action.data.user }); -reducers$2[lbryRedux.ACTIONS.USER_PHONE_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_PHONE_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { phoneVerifyIsPending: false, phoneVerifyErrorMessage: action.data.error }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_NEW_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_EMAIL_NEW_STARTED] = state => Object.assign({}, state, { emailNewIsPending: true, emailNewErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_NEW_SUCCESS] = (state, action) => { +reducers$2[USER_EMAIL_NEW_SUCCESS] = (state, action) => { const user = Object.assign({}, state.user); user.primary_email = action.data.email; return Object.assign({}, state, { @@ -2654,22 +2792,22 @@ reducers$2[lbryRedux.ACTIONS.USER_EMAIL_NEW_SUCCESS] = (state, action) => { }); }; -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_NEW_EXISTS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_EMAIL_NEW_EXISTS] = (state, action) => Object.assign({}, state, { emailToVerify: action.data.email, emailNewIsPending: false }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_NEW_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_EMAIL_NEW_FAILURE] = (state, action) => Object.assign({}, state, { emailNewIsPending: false, emailNewErrorMessage: action.data.error }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_VERIFY_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_EMAIL_VERIFY_STARTED] = state => Object.assign({}, state, { emailVerifyIsPending: true, emailVerifyErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_VERIFY_SUCCESS] = (state, action) => { +reducers$2[USER_EMAIL_VERIFY_SUCCESS] = (state, action) => { const user = Object.assign({}, state.user); user.primary_email = action.data.email; return Object.assign({}, state, { @@ -2679,32 +2817,32 @@ reducers$2[lbryRedux.ACTIONS.USER_EMAIL_VERIFY_SUCCESS] = (state, action) => { }); }; -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_EMAIL_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { emailVerifyIsPending: false, emailVerifyErrorMessage: action.data.error }); -reducers$2[lbryRedux.ACTIONS.USER_EMAIL_VERIFY_SET] = (state, action) => Object.assign({}, state, { +reducers$2[USER_EMAIL_VERIFY_SET] = (state, action) => Object.assign({}, state, { emailToVerify: action.data.email }); -reducers$2[lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_IDENTITY_VERIFY_STARTED] = state => Object.assign({}, state, { identityVerifyIsPending: true, identityVerifyErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_IDENTITY_VERIFY_SUCCESS] = (state, action) => Object.assign({}, state, { identityVerifyIsPending: false, identityVerifyErrorMessage: '', user: action.data.user }); -reducers$2[lbryRedux.ACTIONS.USER_IDENTITY_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_IDENTITY_VERIFY_FAILURE] = (state, action) => Object.assign({}, state, { identityVerifyIsPending: false, identityVerifyErrorMessage: action.data.error }); -reducers$2[lbryRedux.ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS] = (state, action) => { +reducers$2[FETCH_ACCESS_TOKEN_SUCCESS] = (state, action) => { const { token } = action.data; @@ -2713,51 +2851,57 @@ reducers$2[lbryRedux.ACTIONS.FETCH_ACCESS_TOKEN_SUCCESS] = (state, action) => { }); }; -reducers$2[lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_INVITE_STATUS_FETCH_STARTED] = state => Object.assign({}, state, { inviteStatusIsPending: true }); -reducers$2[lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_SUCCESS] = (state, action) => Object.assign({}, state, { +reducers$2[USER_INVITE_STATUS_FETCH_SUCCESS] = (state, action) => Object.assign({}, state, { inviteStatusIsPending: false, invitesRemaining: action.data.invitesRemaining, invitees: action.data.invitees, referralLink: action.data.referralLink }); -reducers$2[lbryRedux.ACTIONS.USER_INVITE_NEW_STARTED] = state => Object.assign({}, state, { +reducers$2[USER_INVITE_NEW_STARTED] = state => Object.assign({}, state, { inviteNewIsPending: true, inviteNewErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_INVITE_NEW_SUCCESS] = state => Object.assign({}, state, { +reducers$2[USER_INVITE_NEW_SUCCESS] = state => Object.assign({}, state, { inviteNewIsPending: false, inviteNewErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_INVITE_NEW_FAILURE] = (state, action) => Object.assign({}, state, { +reducers$2[USER_INVITE_NEW_FAILURE] = (state, action) => Object.assign({}, state, { inviteNewIsPending: false, inviteNewErrorMessage: action.data.error.message }); -reducers$2[lbryRedux.ACTIONS.USER_INVITE_STATUS_FETCH_FAILURE] = state => Object.assign({}, state, { +reducers$2[USER_INVITE_STATUS_FETCH_FAILURE] = state => Object.assign({}, state, { inviteStatusIsPending: false, invitesRemaining: null, invitees: null }); -reducers$2[lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_STARTED] = state => Object.assign({}, state, { - ytChannelImportPending: true, - ytChannelImportErrorMessage: '' +reducers$2[USER_YOUTUBE_IMPORT_STARTED] = state => Object.assign({}, state, { + youtubeChannelImportPending: true, + youtubeChannelImportErrorMessage: '' }); -reducers$2[lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_COMPLETED] = state => Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: '' -}); +reducers$2[USER_YOUTUBE_IMPORT_SUCCESS] = (state, action) => { + const total = action.data.reduce((acc, value) => acc + value.total_published_videos, 0); + const complete = action.data.reduce((acc, value) => acc + value.total_transferred, 0); + return Object.assign({}, state, { + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '', + youtubeChannelImportTotal: total, + youtubeChannelImportComplete: complete + }); +}; -reducers$2[lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_FAILURE] = (state, action) => Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: action.data +reducers$2[USER_YOUTUBE_IMPORT_FAILURE] = (state, action) => Object.assign({}, state, { + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: action.data }); function userReducer(state = defaultState$3, action) { @@ -2952,6 +3096,7 @@ const defaultState$9 = { syncHash: null, syncData: null, setSyncErrorMessage: null, + getSyncErrorMessage: null, syncApplyErrorMessage: '', syncApplyIsPending: false, getSyncIsPending: false, @@ -2960,7 +3105,8 @@ const defaultState$9 = { }; reducers$3[GET_SYNC_STARTED] = state => Object.assign({}, state, { - getSyncIsPending: true + getSyncIsPending: true, + getSyncErrorMessage: null }); reducers$3[GET_SYNC_COMPLETED] = (state, action) => Object.assign({}, state, { @@ -2971,6 +3117,11 @@ reducers$3[GET_SYNC_COMPLETED] = (state, action) => Object.assign({}, state, { hashChanged: action.data.hashChanged }); +reducers$3[GET_SYNC_FAILED] = (state, action) => Object.assign({}, state, { + getSyncIsPending: false, + getSyncErrorMessage: action.data.error +}); + reducers$3[SET_SYNC_STARTED] = state => Object.assign({}, state, { setSyncIsPending: true, setSyncErrorMessage: null @@ -3047,6 +3198,7 @@ const selectHasSyncedWallet = reselect.createSelector(selectState$9, state => st const selectSyncHash = reselect.createSelector(selectState$9, state => state.syncHash); const selectSyncData = reselect.createSelector(selectState$9, state => state.syncData); const selectSetSyncErrorMessage = reselect.createSelector(selectState$9, state => state.setSyncErrorMessage); +const selectGetSyncErrorMessage = reselect.createSelector(selectState$9, state => state.getSyncErrorMessage); const selectGetSyncIsPending = reselect.createSelector(selectState$9, state => state.getSyncIsPending); const selectSetSyncIsPending = reselect.createSelector(selectState$9, state => state.setSyncIsPending); const selectHashChanged = reselect.createSelector(selectState$9, state => state.hashChanged); @@ -3055,6 +3207,7 @@ const selectSyncApplyErrorMessage = reselect.createSelector(selectState$9, state exports.LBRYINC_ACTIONS = action_types; exports.Lbryio = Lbryio; +exports.YOUTUBE_STATUSES = youtube; exports.authReducer = authReducer; exports.blacklistReducer = blacklistReducer; exports.costInfoReducer = costInfoReducer; @@ -3068,6 +3221,7 @@ exports.doCheckSubscription = doCheckSubscription; exports.doCheckSubscriptions = doCheckSubscriptions; exports.doCheckSubscriptionsInit = doCheckSubscriptionsInit; exports.doCheckSync = doCheckSync; +exports.doCheckYoutubeTransfer = doCheckYoutubeTransfer; exports.doClaimEligiblePurchaseRewards = doClaimEligiblePurchaseRewards; exports.doClaimRewardClearError = doClaimRewardClearError; exports.doClaimRewardType = doClaimRewardType; @@ -3147,6 +3301,7 @@ exports.selectFetchingRewards = selectFetchingRewards; exports.selectFetchingTrendingUris = selectFetchingTrendingUris; exports.selectFilteredOutpoints = selectFilteredOutpoints; exports.selectFirstRunCompleted = selectFirstRunCompleted; +exports.selectGetSyncErrorMessage = selectGetSyncErrorMessage; exports.selectGetSyncIsPending = selectGetSyncIsPending; exports.selectHasSyncedWallet = selectHasSyncedWallet; exports.selectHashChanged = selectHashChanged; @@ -3197,8 +3352,9 @@ exports.selectUserIsVerificationCandidate = selectUserIsVerificationCandidate; exports.selectUserPhone = selectUserPhone; exports.selectUserVerifiedEmail = selectUserVerifiedEmail; exports.selectViewMode = selectViewMode; -exports.selectYTImportError = selectYTImportError; -exports.selectYTImportPending = selectYTImportPending; +exports.selectYouTubeImportError = selectYouTubeImportError; +exports.selectYouTubeImportPending = selectYouTubeImportPending; +exports.selectYouTubeImportVideosComplete = selectYouTubeImportVideosComplete; exports.selectYoutubeChannels = selectYoutubeChannels; exports.setSubscriptionLatest = setSubscriptionLatest; exports.statsReducer = statsReducer; diff --git a/dist/bundle.js b/dist/bundle.js index 2813087..9fc2999 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -7,7 +7,7 @@ var a = typeof exports === 'object' ? factory(require("lbry-redux")) : factory(root["lbry-redux"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } -})(window, function(__WEBPACK_EXTERNAL_MODULE__3__) { +})(window, function(__WEBPACK_EXTERNAL_MODULE__4__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -102,342 +102,351 @@ return /******/ (function(modules) { // webpackBootstrap __webpack_require__.r(__webpack_exports__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "LBRYINC_ACTIONS", function() { return constants_action_types__WEBPACK_IMPORTED_MODULE_0__; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Lbryio", function() { return lbryio__WEBPACK_IMPORTED_MODULE_1__["default"]; }); +/* harmony import */ var constants_youtube__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "YOUTUBE_STATUSES", function() { return constants_youtube__WEBPACK_IMPORTED_MODULE_1__; }); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Lbryio", function() { return lbryio__WEBPACK_IMPORTED_MODULE_2__["default"]; }); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewards", function() { return rewards__WEBPACK_IMPORTED_MODULE_2__["default"]; }); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewards", function() { return rewards__WEBPACK_IMPORTED_MODULE_3__["default"]; }); -/* harmony import */ var redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscriptionsReducer", function() { return redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_3__["default"]; }); +/* harmony import */ var redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscriptionsReducer", function() { return redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_4__["default"]; }); -/* harmony import */ var redux_middleware_sync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userStateSyncMiddleware", function() { return redux_middleware_sync__WEBPACK_IMPORTED_MODULE_4__["userStateSyncMiddleware"]; }); +/* harmony import */ var redux_middleware_sync__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userStateSyncMiddleware", function() { return redux_middleware_sync__WEBPACK_IMPORTED_MODULE_5__["userStateSyncMiddleware"]; }); -/* harmony import */ var redux_actions_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return redux_actions_auth__WEBPACK_IMPORTED_MODULE_5__["doGenerateAuthToken"]; }); +/* harmony import */ var redux_actions_auth__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return redux_actions_auth__WEBPACK_IMPORTED_MODULE_6__["doGenerateAuthToken"]; }); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doRewardList"]; }); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__["doRewardList"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimRewardType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__["doClaimRewardType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimEligiblePurchaseRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__["doClaimEligiblePurchaseRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimRewardClearError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__["doClaimRewardClearError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doFetchRewardedContent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_7__["doFetchRewardedContent"]; }); -/* harmony import */ var redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscribe"]; }); +/* harmony import */ var redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doChannelSubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelUnsubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelUnsubscribe"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelUnsubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doChannelUnsubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscriptionEnableNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doChannelSubscriptionEnableNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscriptionDisableNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doChannelSubscriptionDisableNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscription"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doCheckSubscription"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doCheckSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptionsInit", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscriptionsInit"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptionsInit", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doCheckSubscriptionsInit"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCompleteFirstRun", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCompleteFirstRun"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCompleteFirstRun", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doCompleteFirstRun"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchMySubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doFetchMySubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchMySubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doFetchMySubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRecommendedSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doFetchRecommendedSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRecommendedSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doFetchRecommendedSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doRemoveUnreadSubscription"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doRemoveUnreadSubscription"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doRemoveUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doRemoveUnreadSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetViewMode", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doSetViewMode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetViewMode", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doSetViewMode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doShowSuggestedSubs"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doShowSuggestedSubs"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUpdateUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doUpdateUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUpdateUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["doUpdateUnreadSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSubscriptionLatest", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["setSubscriptionLatest"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSubscriptionLatest", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_8__["setSubscriptionLatest"]; }); -/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(19); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchInviteStatus", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doFetchInviteStatus"]; }); +/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchInviteStatus", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doFetchInviteStatus"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doInstallNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doInstallNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doInstallNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doInstallNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doAuthenticate", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doAuthenticate"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doAuthenticate", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doAuthenticate"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserFetch", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserFetch"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserFetch", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserFetch"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserEmailNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckEmailVerified", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserCheckEmailVerified"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckEmailVerified", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserCheckEmailVerified"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailToVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailToVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserEmailToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailVerifyFailure"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserEmailVerifyFailure"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserEmailVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserPhoneNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneReset"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserPhoneReset"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneVerifyFailure"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserPhoneVerifyFailure"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserPhoneVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchAccessToken", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doFetchAccessToken"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchAccessToken", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doFetchAccessToken"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserResendVerificationEmail", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserResendVerificationEmail"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserResendVerificationEmail", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserResendVerificationEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserIdentityVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserIdentityVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserIdentityVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserIdentityVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserInviteNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doUserInviteNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimYoutubeChannels", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doClaimYoutubeChannels"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimYoutubeChannels", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doClaimYoutubeChannels"]; }); -/* harmony import */ var redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_9__["doFetchCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckYoutubeTransfer", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_9__["doCheckYoutubeTransfer"]; }); -/* harmony import */ var redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doBlackListedOutpointsSubscribe", function() { return redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_10__["doBlackListedOutpointsSubscribe"]; }); +/* harmony import */ var redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_10__["doFetchCostInfoForUri"]; }); -/* harmony import */ var redux_actions_filtered__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFilteredOutpointsSubscribe", function() { return redux_actions_filtered__WEBPACK_IMPORTED_MODULE_11__["doFilteredOutpointsSubscribe"]; }); +/* harmony import */ var redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doBlackListedOutpointsSubscribe", function() { return redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_11__["doBlackListedOutpointsSubscribe"]; }); -/* harmony import */ var redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(25); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchFeaturedUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__["doFetchFeaturedUris"]; }); +/* harmony import */ var redux_actions_filtered__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(25); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFilteredOutpointsSubscribe", function() { return redux_actions_filtered__WEBPACK_IMPORTED_MODULE_12__["doFilteredOutpointsSubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchTrendingUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__["doFetchTrendingUris"]; }); +/* harmony import */ var redux_actions_homepage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(26); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchFeaturedUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_13__["doFetchFeaturedUris"]; }); -/* harmony import */ var redux_actions_stats__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(26); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchViewCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_13__["doFetchViewCount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchTrendingUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_13__["doFetchTrendingUris"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchSubCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_13__["doFetchSubCount"]; }); +/* harmony import */ var redux_actions_stats__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchViewCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_14__["doFetchViewCount"]; }); -/* harmony import */ var redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doCheckSync"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchSubCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_14__["doFetchSubCount"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doGetSync"]; }); +/* harmony import */ var redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doCheckSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSetSync"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doGetSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetDefaultAccount", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSetDefaultAccount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doSetSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSyncApply"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetDefaultAccount", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doSetDefaultAccount"]; }); -/* harmony import */ var redux_reducers_auth__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "authReducer", function() { return redux_reducers_auth__WEBPACK_IMPORTED_MODULE_15__["authReducer"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doSyncApply"]; }); -/* harmony import */ var redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewardsReducer", function() { return redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_16__["rewardsReducer"]; }); +/* harmony import */ var redux_reducers_auth__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "authReducer", function() { return redux_reducers_auth__WEBPACK_IMPORTED_MODULE_16__["authReducer"]; }); -/* harmony import */ var redux_reducers_user__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userReducer", function() { return redux_reducers_user__WEBPACK_IMPORTED_MODULE_17__["userReducer"]; }); +/* harmony import */ var redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewardsReducer", function() { return redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_17__["rewardsReducer"]; }); -/* harmony import */ var redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "costInfoReducer", function() { return redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_18__["costInfoReducer"]; }); +/* harmony import */ var redux_reducers_user__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userReducer", function() { return redux_reducers_user__WEBPACK_IMPORTED_MODULE_18__["userReducer"]; }); -/* harmony import */ var redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(32); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blacklistReducer", function() { return redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_19__["blacklistReducer"]; }); +/* harmony import */ var redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(32); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "costInfoReducer", function() { return redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_19__["costInfoReducer"]; }); -/* harmony import */ var redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(33); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filteredReducer", function() { return redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_20__["filteredReducer"]; }); +/* harmony import */ var redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(33); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blacklistReducer", function() { return redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_20__["blacklistReducer"]; }); -/* harmony import */ var redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(34); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "homepageReducer", function() { return redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_21__["homepageReducer"]; }); +/* harmony import */ var redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(34); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filteredReducer", function() { return redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_21__["filteredReducer"]; }); -/* harmony import */ var redux_reducers_stats__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(35); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "statsReducer", function() { return redux_reducers_stats__WEBPACK_IMPORTED_MODULE_22__["statsReducer"]; }); +/* harmony import */ var redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(35); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "homepageReducer", function() { return redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_22__["homepageReducer"]; }); -/* harmony import */ var redux_reducers_sync__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "syncReducer", function() { return redux_reducers_sync__WEBPACK_IMPORTED_MODULE_23__["syncReducer"]; }); +/* harmony import */ var redux_reducers_stats__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "statsReducer", function() { return redux_reducers_stats__WEBPACK_IMPORTED_MODULE_23__["statsReducer"]; }); -/* harmony import */ var redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(37); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__["selectAuthToken"]; }); +/* harmony import */ var redux_reducers_sync__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(37); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "syncReducer", function() { return redux_reducers_sync__WEBPACK_IMPORTED_MODULE_24__["syncReducer"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__["selectIsAuthenticating"]; }); +/* harmony import */ var redux_selectors_auth__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(38); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_25__["selectAuthToken"]; }); -/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(17); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectClaimRewardError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_25__["selectIsAuthenticating"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectIsRewardClaimPending"]; }); +/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["makeSelectClaimRewardError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectRewardAmountByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["makeSelectIsRewardClaimPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectRewardByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["makeSelectRewardAmountByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewardsByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["makeSelectRewardByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewardsById"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectUnclaimedRewardsByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectClaimedRewardsById"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewardsByTransactionId"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectClaimedRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectClaimedRewardsByTransactionId"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectFetchingRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectUnclaimedRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewardValue"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectFetchingRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimsPendingByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectUnclaimedRewardValue"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimErrorsByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectClaimsPendingByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectRewardContentClaimIds"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectClaimErrorsByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectReferralReward"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectRewardContentClaimIds"]; }); -/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(12); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectIsNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_26__["selectReferralReward"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectIsSubscribed"]; }); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(13); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["makeSelectIsNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectUnreadByChannel"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["makeSelectIsSubscribed"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectEnabledChannelNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["makeSelectUnreadByChannel"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectEnabledChannelNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectIsFetchingSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectViewMode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectIsFetchingSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSuggested"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectViewMode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectIsFetchingSuggested"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectSuggested"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSuggestedChannels"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectIsFetchingSuggested"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectFirstRunCompleted"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectSuggestedChannels"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectShowSuggestedSubs"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectFirstRunCompleted"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptionsBeingFetched"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectShowSuggestedSubs"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadByChannel"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectSubscriptionsBeingFetched"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadAmount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectUnreadByChannel"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectUnreadAmount"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptionClaims"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectUnreadSubscriptions"]; }); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(18); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthenticationIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectAuthenticationIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_27__["selectSubscriptionClaims"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsPending"]; }); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(19); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthenticationIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectAuthenticationIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUser", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserEmail"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUser", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserPhone", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserPhone"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserCountryCode", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserCountryCode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserPhone", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserPhone"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserCountryCode", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserCountryCode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectEmailToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsRewardApproved", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsRewardApproved"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectPhoneToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsRewardApproved", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserIsRewardApproved"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectEmailNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectEmailNewErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectPhoneNewErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectPhoneNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectEmailVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectEmailVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectPhoneVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectIdentityVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectPhoneVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectIdentityVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectIdentityVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsVerificationCandidate", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsVerificationCandidate"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectIdentityVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAccessToken", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectAccessToken"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsVerificationCandidate", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserIsVerificationCandidate"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteStatusIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAccessToken", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectAccessToken"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitesRemaining", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInvitesRemaining"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInviteStatusIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitees", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInvitees"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitesRemaining", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInvitesRemaining"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusFailed", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteStatusFailed"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitees", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInvitees"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusFailed", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInviteStatusFailed"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInviteNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteReferralLink"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInviteNewErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserVerifiedEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserVerifiedEmail"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserInviteReferralLink"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYoutubeChannels", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectYoutubeChannels"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserVerifiedEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectUserVerifiedEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYTImportPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectYTImportPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYoutubeChannels", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectYoutubeChannels"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYTImportError", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectYTImportError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectYouTubeImportPending"]; }); -/* harmony import */ var redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(38); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["makeSelectFetchingCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportError", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectYouTubeImportError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["makeSelectCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportVideosComplete", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_28__["selectYouTubeImportVideosComplete"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAllCostInfoByUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["selectAllCostInfoByUri"]; }); +/* harmony import */ var redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(39); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_29__["makeSelectFetchingCostInfoForUri"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["selectFetchingCostInfo"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_29__["makeSelectCostInfoForUri"]; }); -/* harmony import */ var redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(39); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_29__["selectBlackListedOutpoints"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAllCostInfoByUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_29__["selectAllCostInfoByUri"]; }); -/* harmony import */ var redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(40); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_30__["selectFilteredOutpoints"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_29__["selectFetchingCostInfo"]; }); -/* harmony import */ var redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(41); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFeaturedUris"]; }); +/* harmony import */ var redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(40); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_30__["selectBlackListedOutpoints"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFetchingFeaturedUris"]; }); +/* harmony import */ var redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(41); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_31__["selectFilteredOutpoints"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectTrendingUris"]; }); +/* harmony import */ var redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(42); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_32__["selectFeaturedUris"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFetchingTrendingUris"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_32__["selectFetchingFeaturedUris"]; }); -/* harmony import */ var redux_selectors_stats__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(42); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_32__["makeSelectViewCountForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_32__["selectTrendingUris"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectSubCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_32__["makeSelectSubCountForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_32__["selectFetchingTrendingUris"]; }); -/* harmony import */ var redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(43); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHasSyncedWallet", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectHasSyncedWallet"]; }); +/* harmony import */ var redux_selectors_stats__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(43); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_33__["makeSelectViewCountForUri"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncData", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncData"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectSubCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_33__["makeSelectSubCountForUri"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncHash", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncHash"]; }); +/* harmony import */ var redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(44); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHasSyncedWallet", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectHasSyncedWallet"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSetSyncErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncData", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSyncData"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectGetSyncIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncHash", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSyncHash"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSetSyncIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSetSyncErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncApplyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectGetSyncErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectHashChanged"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectGetSyncIsPending"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSetSyncIsPending"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSyncApplyIsPending"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectHashChanged"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_34__["selectSyncApplyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncApplyErrorMessage"]; }); @@ -492,6 +501,42 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GENERATE_AUTH_TOKEN_FAILURE", function() { return GENERATE_AUTH_TOKEN_FAILURE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GENERATE_AUTH_TOKEN_STARTED", function() { return GENERATE_AUTH_TOKEN_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GENERATE_AUTH_TOKEN_SUCCESS", function() { return GENERATE_AUTH_TOKEN_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTHENTICATION_STARTED", function() { return AUTHENTICATION_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTHENTICATION_SUCCESS", function() { return AUTHENTICATION_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTHENTICATION_FAILURE", function() { return AUTHENTICATION_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_DECLINE", function() { return USER_EMAIL_DECLINE; }); +/* 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_FAILURE", function() { return USER_EMAIL_NEW_FAILURE; }); +/* 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; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_FAILURE", function() { return USER_EMAIL_VERIFY_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_EMAIL_VERIFY_RETRY", function() { return USER_EMAIL_VERIFY_RETRY; }); +/* 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; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_NEW_FAILURE", function() { return USER_PHONE_NEW_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_VERIFY_STARTED", function() { return USER_PHONE_VERIFY_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_VERIFY_SUCCESS", function() { return USER_PHONE_VERIFY_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_PHONE_VERIFY_FAILURE", function() { return USER_PHONE_VERIFY_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_IDENTITY_VERIFY_STARTED", function() { return USER_IDENTITY_VERIFY_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_IDENTITY_VERIFY_SUCCESS", function() { return USER_IDENTITY_VERIFY_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_IDENTITY_VERIFY_FAILURE", function() { return USER_IDENTITY_VERIFY_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_FETCH_STARTED", function() { return USER_FETCH_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_FETCH_SUCCESS", function() { return USER_FETCH_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_FETCH_FAILURE", function() { return USER_FETCH_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_STATUS_FETCH_STARTED", function() { return USER_INVITE_STATUS_FETCH_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_STATUS_FETCH_SUCCESS", function() { return USER_INVITE_STATUS_FETCH_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_STATUS_FETCH_FAILURE", function() { return USER_INVITE_STATUS_FETCH_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_NEW_STARTED", function() { return USER_INVITE_NEW_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_NEW_SUCCESS", function() { return USER_INVITE_NEW_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_INVITE_NEW_FAILURE", function() { return USER_INVITE_NEW_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FETCH_ACCESS_TOKEN_SUCCESS", function() { return FETCH_ACCESS_TOKEN_SUCCESS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_YOUTUBE_IMPORT_STARTED", function() { return USER_YOUTUBE_IMPORT_STARTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_YOUTUBE_IMPORT_FAILURE", function() { return USER_YOUTUBE_IMPORT_FAILURE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USER_YOUTUBE_IMPORT_SUCCESS", function() { return USER_YOUTUBE_IMPORT_SUCCESS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FETCH_FEATURED_CONTENT_STARTED", function() { return FETCH_FEATURED_CONTENT_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FETCH_FEATURED_CONTENT_COMPLETED", function() { return FETCH_FEATURED_CONTENT_COMPLETED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FETCH_TRENDING_CONTENT_STARTED", function() { return FETCH_TRENDING_CONTENT_STARTED; }); @@ -556,6 +601,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FETCH_SUB_COUNT_COMPLETED", function() { return FETCH_SUB_COUNT_COMPLETED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GET_SYNC_STARTED", function() { return GET_SYNC_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GET_SYNC_COMPLETED", function() { return GET_SYNC_COMPLETED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GET_SYNC_FAILED", function() { return GET_SYNC_FAILED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_SYNC_STARTED", function() { return SET_SYNC_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_SYNC_FAILED", function() { return SET_SYNC_FAILED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_SYNC_COMPLETED", function() { return SET_SYNC_COMPLETED; }); @@ -563,10 +609,46 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_STARTED", function() { return SYNC_APPLY_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_COMPLETED", function() { return SYNC_APPLY_COMPLETED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_FAILED", function() { return SYNC_APPLY_FAILED; }); -// Auth Token +// User var GENERATE_AUTH_TOKEN_FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE'; var GENERATE_AUTH_TOKEN_STARTED = 'GENERATE_AUTH_TOKEN_STARTED'; -var GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS'; // Claims +var GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS'; +var AUTHENTICATION_STARTED = 'AUTHENTICATION_STARTED'; +var AUTHENTICATION_SUCCESS = 'AUTHENTICATION_SUCCESS'; +var AUTHENTICATION_FAILURE = 'AUTHENTICATION_FAILURE'; +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_FAILURE = 'USER_EMAIL_NEW_FAILURE'; +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'; +var USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE'; +var USER_EMAIL_VERIFY_RETRY = 'USER_EMAIL_VERIFY_RETRY'; +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'; +var USER_PHONE_NEW_FAILURE = 'USER_PHONE_NEW_FAILURE'; +var USER_PHONE_VERIFY_STARTED = 'USER_PHONE_VERIFY_STARTED'; +var USER_PHONE_VERIFY_SUCCESS = 'USER_PHONE_VERIFY_SUCCESS'; +var USER_PHONE_VERIFY_FAILURE = 'USER_PHONE_VERIFY_FAILURE'; +var USER_IDENTITY_VERIFY_STARTED = 'USER_IDENTITY_VERIFY_STARTED'; +var USER_IDENTITY_VERIFY_SUCCESS = 'USER_IDENTITY_VERIFY_SUCCESS'; +var USER_IDENTITY_VERIFY_FAILURE = 'USER_IDENTITY_VERIFY_FAILURE'; +var USER_FETCH_STARTED = 'USER_FETCH_STARTED'; +var USER_FETCH_SUCCESS = 'USER_FETCH_SUCCESS'; +var USER_FETCH_FAILURE = 'USER_FETCH_FAILURE'; +var USER_INVITE_STATUS_FETCH_STARTED = 'USER_INVITE_STATUS_FETCH_STARTED'; +var USER_INVITE_STATUS_FETCH_SUCCESS = 'USER_INVITE_STATUS_FETCH_SUCCESS'; +var USER_INVITE_STATUS_FETCH_FAILURE = 'USER_INVITE_STATUS_FETCH_FAILURE'; +var USER_INVITE_NEW_STARTED = 'USER_INVITE_NEW_STARTED'; +var USER_INVITE_NEW_SUCCESS = 'USER_INVITE_NEW_SUCCESS'; +var USER_INVITE_NEW_FAILURE = 'USER_INVITE_NEW_FAILURE'; +var FETCH_ACCESS_TOKEN_SUCCESS = 'FETCH_ACCESS_TOKEN_SUCCESS'; +var USER_YOUTUBE_IMPORT_STARTED = 'USER_YOUTUBE_IMPORT_STARTED'; +var USER_YOUTUBE_IMPORT_FAILURE = 'USER_YOUTUBE_IMPORT_FAILURE'; +var USER_YOUTUBE_IMPORT_SUCCESS = 'USER_YOUTUBE_IMPORT_SUCCESS'; // Claims var FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED'; var FETCH_FEATURED_CONTENT_COMPLETED = 'FETCH_FEATURED_CONTENT_COMPLETED'; @@ -638,6 +720,7 @@ var FETCH_SUB_COUNT_COMPLETED = 'FETCH_SUB_COUNT_COMPLETED'; // Cross-device Syn var GET_SYNC_STARTED = 'GET_SYNC_STARTED'; var GET_SYNC_COMPLETED = 'GET_SYNC_COMPLETED'; +var GET_SYNC_FAILED = 'GET_SYNC_FAILED'; var SET_SYNC_STARTED = 'SET_SYNC_STARTED'; var SET_SYNC_FAILED = 'SET_SYNC_FAILED'; var SET_SYNC_COMPLETED = 'SET_SYNC_COMPLETED'; @@ -650,12 +733,25 @@ var SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; /* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NOT_TRANSFERRED", function() { return NOT_TRANSFERRED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PENDING_TRANSFER", function() { return PENDING_TRANSFER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPLETED_TRANSFER", function() { return COMPLETED_TRANSFER; }); +var NOT_TRANSFERRED = 'not_transferred'; +var PENDING_TRANSFER = 'pending_transfer'; +var COMPLETED_TRANSFER = 'completed_transfer'; + +/***/ }), +/* 3 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); +/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5); /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_2__); 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); } @@ -896,24 +992,24 @@ Lbryio.setOverride = function (methodName, newMethod) { /* harmony default export */ __webpack_exports__["default"] = (Lbryio); /***/ }), -/* 3 */ +/* 4 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__3__; +module.exports = __WEBPACK_EXTERNAL_MODULE__4__; /***/ }), -/* 4 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.decode = exports.parse = __webpack_require__(5); -exports.encode = exports.stringify = __webpack_require__(6); +exports.decode = exports.parse = __webpack_require__(6); +exports.encode = exports.stringify = __webpack_require__(7); /***/ }), -/* 5 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1004,7 +1100,7 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 6 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1096,14 +1192,14 @@ var objectKeys = Object.keys || function (obj) { /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); 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; } @@ -1211,16 +1307,16 @@ rewards.setCallback = function (name, method) { /* harmony default export */ __webpack_exports__["default"] = (rewards); /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10); +/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11); var _handleActions; 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; } @@ -1402,7 +1498,7 @@ var defaultState = { }), _handleActions), defaultState)); /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1427,7 +1523,7 @@ var SUGGESTED_TOP_SUBSCRIBED = 'top_subscribed'; var SUGGESTED_FEATURED = 'featured'; /***/ }), -/* 10 */ +/* 11 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1455,17 +1551,17 @@ var handleActions = function handleActions(actionMap, defaultState) { }; /***/ }), -/* 11 */ +/* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "userStateSyncMiddleware", function() { return userStateSyncMiddleware; }); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1); -/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); 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; } @@ -1539,7 +1635,7 @@ function userStateSyncMiddleware() { } /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1561,12 +1657,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return makeSelectIsSubscribed; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return makeSelectIsNew; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return selectEnabledChannelNotifications; }); -/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); +/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var util_swap_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14); +/* harmony import */ var util_swap_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15); 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; } @@ -1810,7 +1906,7 @@ var selectEnabledChannelNotifications = Object(reselect__WEBPACK_IMPORTED_MODULE }); /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1941,7 +2037,7 @@ function createStructuredSelector(selectors) { } /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1960,14 +2056,14 @@ function swapKeyAndValue(dict) { } /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return doGenerateAuthToken; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); function doGenerateAuthToken(installationId) { @@ -2001,7 +2097,7 @@ function doGenerateAuthToken(installationId) { } /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2011,13 +2107,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return doClaimEligiblePurchaseRewards; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return doClaimRewardClearError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return doFetchRewardedContent; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18); -/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7); +/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19); +/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8); @@ -2190,7 +2286,7 @@ function doFetchRewardedContent() { } /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2210,9 +2306,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return makeSelectRewardAmountByType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return selectRewardContentClaimIds; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return selectReferralReward; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); @@ -2300,7 +2396,7 @@ var selectReferralReward = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createS }); /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2336,9 +2432,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return selectUserInviteNewIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return selectUserInviteNewErrorMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return selectUserInviteReferralLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYTImportPending", function() { return selectYTImportPending; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYTImportError", function() { return selectYTImportError; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportPending", function() { return selectYouTubeImportPending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportError", function() { return selectYouTubeImportError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectYouTubeImportVideosComplete", function() { return selectYouTubeImportVideosComplete; }); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -2434,15 +2531,23 @@ var selectUserInviteNewErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0 var selectUserInviteReferralLink = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { return state.referralLink; }); -var selectYTImportPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.ytChannelImportPending; +var selectYouTubeImportPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.youtubeChannelImportPending; }); -var selectYTImportError = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.ytChannelImportErrorMessage; +var selectYouTubeImportError = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.youtubeChannelImportErrorMessage; +}); +var selectYouTubeImportVideosComplete = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + var total = state.youtubeChannelImportTotal; + var complete = state.youtubeChannelImportComplete || 0; + + if (total) { + return [complete, total]; + } }); /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2465,12 +2570,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserIdentityVerify", function() { return doUserIdentityVerify; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return doUserInviteNew; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimYoutubeChannels", function() { return doClaimYoutubeChannels; }); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doCheckYoutubeTransfer", function() { return doCheckYoutubeTransfer; }); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2); +/* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } @@ -2484,28 +2591,29 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + function doFetchInviteStatus() { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_STARTED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_STATUS_FETCH_STARTED"] }); - Promise.all([lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user', 'invite_status'), lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user_referral_code', 'list')]).then(function (_ref) { + Promise.all([lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'invite_status'), lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_referral_code', 'list')]).then(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), status = _ref2[0], code = _ref2[1]; - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doRewardList"])()); + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_STATUS_FETCH_SUCCESS"], data: { invitesRemaining: status.invites_remaining ? status.invites_remaining : 0, invitees: status.invitees, - referralLink: "".concat(lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].CONNECTION_STRING, "user/refer?r=").concat(code) + referralLink: "".concat(lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].CONNECTION_STRING, "user/refer?r=").concat(code) } }); })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_STATUS_FETCH_FAILURE"], data: { error: error } @@ -2525,7 +2633,7 @@ function doInstallNew(appVersion) { payload.daemon_version = version.lbrynet_version; payload.operating_system = os || version.os_system; payload.platform = version.platform; - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('install', 'new', payload); + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('install', 'new', payload); }); }); } // TODO: Call doInstallNew separately so we don't have to pass appVersion and os_system params? @@ -2534,22 +2642,22 @@ function doAuthenticate(appVersion) { var os = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_STARTED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_STARTED"] }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].authenticate().then(function (user) { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].authenticate().then(function (user) { // analytics.setUser(user); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_SUCCESS"], data: { user: user } }); - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doRewardList"])()); + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch(doFetchInviteStatus()); doInstallNew(appVersion, os); })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["AUTHENTICATION_FAILURE"], data: { error: error } @@ -2560,20 +2668,19 @@ function doAuthenticate(appVersion) { function doUserFetch() { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_STARTED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_STARTED"] }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].getCurrentUser().then(function (user) { - // analytics.setUser(user); - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doRewardList"])()); + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].getCurrentUser().then(function (user) { + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_SUCCESS"], data: { user: user } }); })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_FAILURE"], data: { error: error } @@ -2584,11 +2691,11 @@ function doUserFetch() { function doUserCheckEmailVerified() { // This will happen in the background so we don't need loading booleans return function (dispatch) { - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].getCurrentUser().then(function (user) { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].getCurrentUser().then(function (user) { if (user.has_verified_email) { - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doRewardList"])()); + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doRewardList"])()); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_FETCH_SUCCESS"], data: { user: user } @@ -2599,13 +2706,13 @@ function doUserCheckEmailVerified() { } function doUserPhoneReset() { return { - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_RESET + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_RESET"] }; } function doUserPhoneNew(phone, countryCode) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_STARTED, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_NEW_STARTED"], data: { phone: phone, country_code: countryCode @@ -2614,7 +2721,7 @@ function doUserPhoneNew(phone, countryCode) { var success = function success() { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_NEW_SUCCESS"], data: { phone: phone } @@ -2623,14 +2730,14 @@ function doUserPhoneNew(phone, countryCode) { var failure = function failure(error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_NEW_FAILURE"], data: { error: error } }); }; - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user', 'phone_number_new', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'phone_number_new', { phone_number: phone, country_code: countryCode }, 'post').then(success, failure); @@ -2638,7 +2745,7 @@ function doUserPhoneNew(phone, countryCode) { } function doUserPhoneVerifyFailure(error) { return { - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_VERIFY_FAILURE"], data: { error: error } @@ -2646,25 +2753,25 @@ function doUserPhoneVerifyFailure(error) { } function doUserPhoneVerify(verificationCode) { return function (dispatch, getState) { - var phoneNumber = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__["selectPhoneToVerify"])(getState()); - var countryCode = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__["selectUserCountryCode"])(getState()); + var phoneNumber = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectPhoneToVerify"])(getState()); + var countryCode = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectUserCountryCode"])(getState()); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_STARTED, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_VERIFY_STARTED"], code: verificationCode }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user', 'phone_number_confirm', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'phone_number_confirm', { verification_code: verificationCode, phone_number: phoneNumber, country_code: countryCode }, 'post').then(function (user) { if (user.is_identity_verified) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_PHONE_VERIFY_SUCCESS"], data: { user: user } }); - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doClaimRewardType"])(rewards__WEBPACK_IMPORTED_MODULE_3__["default"].TYPE_NEW_USER)); + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doClaimRewardType"])(rewards__WEBPACK_IMPORTED_MODULE_4__["default"].TYPE_NEW_USER)); } })["catch"](function (error) { return dispatch(doUserPhoneVerifyFailure(error)); @@ -2674,7 +2781,7 @@ function doUserPhoneVerify(verificationCode) { function doUserEmailToVerify(email) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_SET, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_SET"], data: { email: email } @@ -2684,13 +2791,13 @@ function doUserEmailToVerify(email) { function doUserEmailNew(email) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_STARTED, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_STARTED"], email: email }); var success = function success() { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_SUCCESS"], data: { email: email } @@ -2700,19 +2807,19 @@ function doUserEmailNew(email) { var failure = function failure(error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_FAILURE"], data: { error: error } }); }; - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user_email', 'new', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_email', 'new', { email: email, send_verification_email: true }, 'post')["catch"](function (error) { if (error.response && error.response.status === 409) { - return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user_email', 'resend_token', { + return lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_email', 'resend_token', { email: email, only_if_expired: true }, 'post').then(success, failure); @@ -2725,13 +2832,13 @@ function doUserEmailNew(email) { function doUserResendVerificationEmail(email) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_RETRY, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_RETRY"], email: email }); var success = function success() { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_SUCCESS"], data: { email: email } @@ -2741,14 +2848,14 @@ function doUserResendVerificationEmail(email) { var failure = function failure(error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_NEW_FAILURE"], data: { error: error } }); }; - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user_email', 'resend_token', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_email', 'resend_token', { email: email }, 'post')["catch"](function (error) { if (error.response && error.response.status === 409) { @@ -2759,7 +2866,7 @@ function doUserResendVerificationEmail(email) { } function doUserEmailVerifyFailure(error) { return { - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_FAILURE"], data: { error: error } @@ -2767,20 +2874,20 @@ function doUserEmailVerifyFailure(error) { } function doUserEmailVerify(verificationToken, recaptcha) { return function (dispatch, getState) { - var email = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__["selectEmailToVerify"])(getState()); + var email = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectEmailToVerify"])(getState()); dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_STARTED, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_STARTED"], code: verificationToken, recaptcha: recaptcha }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user_email', 'confirm', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user_email', 'confirm', { verification_token: verificationToken, email: email, recaptcha: recaptcha }, 'post').then(function (userEmail) { if (userEmail.is_verified) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_EMAIL_VERIFY_SUCCESS"], data: { email: email } @@ -2798,39 +2905,39 @@ function doFetchAccessToken() { return function (dispatch) { var success = function success(token) { return dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].FETCH_ACCESS_TOKEN_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["FETCH_ACCESS_TOKEN_SUCCESS"], data: { token: token } }); }; - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].getAuthToken().then(success); + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].getAuthToken().then(success); }; } function doUserIdentityVerify(stripeToken) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_STARTED, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_IDENTITY_VERIFY_STARTED"], token: stripeToken }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user', 'verify_identity', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'verify_identity', { stripe_token: stripeToken }, 'post').then(function (user) { if (user.is_identity_verified) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_IDENTITY_VERIFY_SUCCESS"], data: { user: user } }); - dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__["doClaimRewardType"])(rewards__WEBPACK_IMPORTED_MODULE_3__["default"].TYPE_NEW_USER)); + dispatch(Object(redux_actions_rewards__WEBPACK_IMPORTED_MODULE_2__["doClaimRewardType"])(rewards__WEBPACK_IMPORTED_MODULE_4__["default"].TYPE_NEW_USER)); } else { throw new Error('Your identity is still not verified. This should not happen.'); // shouldn't happen } })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_IDENTITY_VERIFY_FAILURE"], data: { error: error.toString() } @@ -2841,13 +2948,13 @@ function doUserIdentityVerify(stripeToken) { function doUserInviteNew(email) { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_STARTED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_NEW_STARTED"] }); - lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('user', 'invite', { + lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('user', 'invite', { email: email }, 'post').then(function () { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_SUCCESS, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_NEW_SUCCESS"], data: { email: email } @@ -2858,7 +2965,7 @@ function doUserInviteNew(email) { dispatch(doFetchInviteStatus()); })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_INVITE_NEW_FAILURE"], data: { error: error } @@ -2869,19 +2976,21 @@ function doUserInviteNew(email) { function doClaimYoutubeChannels() { return function (dispatch) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_STARTED"] }); - lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) { + var transferResponse; + return lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) { return addressList.sort(function (a, b) { return a.used_times - b.used_times; })[0]; }).then(function (address) { - return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('yt', 'transfer', { + return lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('yt', 'transfer', { address: address.address, public_key: address.pubkey }).then(function (response) { - if (response && response.success) { - Promise.all(response.map(function (channelMeta) { + if (response && response.length) { + transferResponse = response; + return Promise.all(response.map(function (channelMeta) { if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].channel_import({ channel_data: channelMeta.channel.channel_certificate @@ -2891,7 +3000,8 @@ function doClaimYoutubeChannels() { return null; })).then(function () { var actions = [{ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_COMPLETED + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_SUCCESS"], + data: transferResponse }]; actions.push(doUserFetch()); actions.push(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_0__["doFetchChannelListMine"])()); @@ -2901,7 +3011,29 @@ function doClaimYoutubeChannels() { }); })["catch"](function (error) { dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_FAILURE, + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_FAILURE"], + data: String(error) + }); + }); + }; +} +function doCheckYoutubeTransfer() { + return function (dispatch) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_STARTED"] + }); + return lbryio__WEBPACK_IMPORTED_MODULE_5__["default"].call('yt', 'transfer').then(function (response) { + if (response && response.length) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_SUCCESS"], + data: response + }); + } else { + throw new Error(); + } + })["catch"](function (error) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_1__["USER_YOUTUBE_IMPORT_FAILURE"], data: String(error) }); }); @@ -2909,7 +3041,7 @@ function doClaimYoutubeChannels() { } /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2930,15 +3062,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return doShowSuggestedSubs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return doChannelSubscriptionEnableNotifications; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return doChannelSubscriptionDisableNotifications; }); -/* harmony import */ var constants_claim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); -/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3); +/* harmony import */ var constants_claim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); -/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7); +/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8); 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; } @@ -3362,7 +3494,7 @@ var doChannelSubscriptionDisableNotifications = function doChannelSubscriptionDi }; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3377,15 +3509,15 @@ var CHANNEL_NEW = 'new'; var PAGE_SIZE = 20; /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return doFetchCostInfoForUri; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_2__); @@ -3432,14 +3564,14 @@ function doFetchCostInfoForUri(uri) { } /***/ }), -/* 23 */ +/* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchBlackListedOutpoints", function() { return doFetchBlackListedOutpoints; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doBlackListedOutpointsSubscribe", function() { return doBlackListedOutpointsSubscribe; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } @@ -3505,14 +3637,14 @@ function doBlackListedOutpointsSubscribe() { } /***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchFilteredOutpoints", function() { return doFetchFilteredOutpoints; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFilteredOutpointsSubscribe", function() { return doFilteredOutpointsSubscribe; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } @@ -3575,15 +3707,15 @@ function doFilteredOutpointsSubscribe() { } /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchFeaturedUris", function() { return doFetchFeaturedUris; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchTrendingUris", function() { return doFetchTrendingUris; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } @@ -3671,14 +3803,14 @@ function doFetchTrendingUris() { } /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchViewCount", function() { return doFetchViewCount; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchSubCount", function() { return doFetchSubCount; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); @@ -3732,58 +3864,23 @@ var doFetchSubCount = function doFetchSubCount(claimId) { }; /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return doSetSync; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doSetDefaultAccount", function() { return doSetDefaultAccount; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return doSetSync; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return doGetSync; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return doSyncApply; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return doCheckSync; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_2__); -function doSetSync(oldHash, newHash, data) { - return function (dispatch) { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_STARTED"] - }); - lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('sync', 'set', { - old_hash: oldHash, - new_hash: newHash, - data: data - }, 'post').then(function (response) { - if (!response.hash) { - return dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], - data: { - error: 'No hash returned for sync/set.' - } - }); - } - - return dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_COMPLETED"], - data: { - syncHash: response.hash - } - }); - })["catch"](function (error) { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], - data: { - error: error - } - }); - }); - }; -} function doSetDefaultAccount(success, failure) { return function (dispatch) { dispatch({ @@ -3820,11 +3917,9 @@ function doSetDefaultAccount(success, failure) { failure(err); } }); - } else { + } else if (failure) { // no default account to set - if (failure) { - failure('Could not set a default account'); // fail - } + failure('Could not set a default account'); // fail } })["catch"](function (err) { if (failure) { @@ -3833,33 +3928,83 @@ function doSetDefaultAccount(success, failure) { }); }; } -function doGetSync(password) { +function doSetSync(oldHash, newHash, data, password) { + return function (dispatch) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_STARTED"] + }); + lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('sync', 'set', { + old_hash: oldHash, + new_hash: newHash, + data: data + }, 'post').then(function (response) { + if (!response.hash) { + return dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], + data: { + error: 'No hash returned for sync/set.' + } + }); + } + + if (oldHash && newHash !== oldHash) { + dispatch(doSetDefaultAccount(function () { + if (password !== undefined) { + lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].account_unlock({ + password: password + }); + dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["doFetchChannelListMine"])()); + } + })); + } + + return dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_COMPLETED"], + data: { + syncHash: response.hash + } + }); + })["catch"](function (error) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], + data: { + error: error + } + }); + }); + }; +} +function doGetSync() { + var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_STARTED"] }); + var data = {}; lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_hash().then(function (hash) { lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('sync', 'get', { hash: hash }, 'post').then(function (response) { - var data = { - hasSyncedWallet: true - }; + var syncHash = response.hash; + data.syncHash = syncHash; + data.syncData = response.data; + data.hasSyncedWallet = true; if (response.changed) { - var syncHash = response.hash; - data.syncHash = syncHash; - data.syncData = response.data; - lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_apply({ + return lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_apply({ password: password, data: response.data }).then(function (_ref) { var walletHash = _ref.hash, walletData = _ref.data; + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_COMPLETED"], + data: data + }); if (walletHash !== syncHash) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData)); + dispatch(doSetSync(syncHash, walletHash, walletData, password)); } }); } @@ -3869,23 +4014,32 @@ function doGetSync(password) { data: data }); })["catch"](function () { - // user doesn't have a synced wallet - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_COMPLETED"], - data: { - hasSyncedWallet: false, - syncHash: null - } - }); // call sync_apply to get data to sync - // first time sync. use any string for old hash + if (data.hasSyncedWallet) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_FAILED"], + data: { + error: 'Error getting synced wallet' + } + }); + } else { + // user doesn't have a synced wallet + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_COMPLETED"], + data: { + hasSyncedWallet: false, + syncHash: null + } + }); // call sync_apply to get data to sync + // first time sync. use any string for old hash - lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_apply({ - password: password - }).then(function (_ref2) { - var walletHash = _ref2.hash, - data = _ref2.data; - return dispatch(doSetSync('', walletHash, data)); - }); + lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_apply({ + password: password + }).then(function (_ref2) { + var walletHash = _ref2.hash, + syncApplyData = _ref2.data; + return dispatch(doSetSync('', walletHash, syncApplyData, password)); + }); + } }); }); }; @@ -3953,7 +4107,7 @@ function doCheckSync() { } /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3995,13 +4149,13 @@ function authReducer() { } /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rewardsReducer", function() { return rewardsReducer; }); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } @@ -4126,14 +4280,13 @@ function rewardsReducer() { } /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "userReducer", function() { return userReducer; }); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); var reducers = {}; var defaultState = { @@ -4148,11 +4301,11 @@ var defaultState = { invitesRemaining: undefined, invitees: undefined, user: undefined, - ytChannelImportPending: false, - ytChannelImportErrorMessage: '' + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '' }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["AUTHENTICATION_STARTED"]] = function (state) { return Object.assign({}, state, { authenticationIsPending: true, userIsPending: true, @@ -4160,7 +4313,7 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_START }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["AUTHENTICATION_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { authenticationIsPending: false, userIsPending: false, @@ -4168,7 +4321,7 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_SUCCE }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_FAILURE] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["AUTHENTICATION_FAILURE"]] = function (state) { return Object.assign({}, state, { authenticationIsPending: false, userIsPending: false, @@ -4176,13 +4329,13 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_FAILU }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_FETCH_STARTED"]] = function (state) { return Object.assign({}, state, { userIsPending: true }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_FETCH_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { userIsPending: false, user: action.data.user, @@ -4190,14 +4343,14 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_SUCCESS] }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_FAILURE] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_FETCH_FAILURE"]] = function (state) { return Object.assign({}, state, { userIsPending: true, user: null }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_STARTED] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_NEW_STARTED"]] = function (state, action) { var user = Object.assign({}, state.user); user.country_code = action.data.country_code; return Object.assign({}, state, { @@ -4207,34 +4360,34 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_START }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_NEW_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { phoneToVerify: action.data.phone, phoneNewIsPending: false }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_RESET] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_RESET"]] = function (state) { return Object.assign({}, state, { phoneToVerify: null }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_NEW_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_NEW_FAILURE"]] = function (state, action) { return Object.assign({}, state, { phoneNewIsPending: false, phoneNewErrorMessage: action.data.error }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_VERIFY_STARTED"]] = function (state) { return Object.assign({}, state, { phoneVerifyIsPending: true, phoneVerifyErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_VERIFY_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { phoneToVerify: '', phoneVerifyIsPending: false, @@ -4242,21 +4395,21 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_SU }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_PHONE_VERIFY_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_PHONE_VERIFY_FAILURE"]] = function (state, action) { return Object.assign({}, state, { phoneVerifyIsPending: false, phoneVerifyErrorMessage: action.data.error }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_STARTED"]] = function (state) { return Object.assign({}, state, { emailNewIsPending: true, emailNewErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_SUCCESS"]] = function (state, action) { var user = Object.assign({}, state.user); user.primary_email = action.data.email; return Object.assign({}, state, { @@ -4266,28 +4419,28 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_SUCCE }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_EXISTS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_EXISTS"]] = function (state, action) { return Object.assign({}, state, { emailToVerify: action.data.email, emailNewIsPending: false }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_NEW_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_NEW_FAILURE"]] = function (state, action) { return Object.assign({}, state, { emailNewIsPending: false, emailNewErrorMessage: action.data.error }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_VERIFY_STARTED"]] = function (state) { return Object.assign({}, state, { emailVerifyIsPending: true, emailVerifyErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_VERIFY_SUCCESS"]] = function (state, action) { var user = Object.assign({}, state.user); user.primary_email = action.data.email; return Object.assign({}, state, { @@ -4297,27 +4450,27 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_SU }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_VERIFY_FAILURE"]] = function (state, action) { return Object.assign({}, state, { emailVerifyIsPending: false, emailVerifyErrorMessage: action.data.error }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_EMAIL_VERIFY_SET] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_EMAIL_VERIFY_SET"]] = function (state, action) { return Object.assign({}, state, { emailToVerify: action.data.email }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_IDENTITY_VERIFY_STARTED"]] = function (state) { return Object.assign({}, state, { identityVerifyIsPending: true, identityVerifyErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_IDENTITY_VERIFY_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { identityVerifyIsPending: false, identityVerifyErrorMessage: '', @@ -4325,27 +4478,27 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_IDENTITY_VERIFY_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_IDENTITY_VERIFY_FAILURE"]] = function (state, action) { return Object.assign({}, state, { identityVerifyIsPending: false, identityVerifyErrorMessage: action.data.error }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].FETCH_ACCESS_TOKEN_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["FETCH_ACCESS_TOKEN_SUCCESS"]] = function (state, action) { var token = action.data.token; return Object.assign({}, state, { accessToken: token }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_STATUS_FETCH_STARTED"]] = function (state) { return Object.assign({}, state, { inviteStatusIsPending: true }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_SUCCESS] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_STATUS_FETCH_SUCCESS"]] = function (state, action) { return Object.assign({}, state, { inviteStatusIsPending: false, invitesRemaining: action.data.invitesRemaining, @@ -4354,28 +4507,28 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_F }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_NEW_STARTED"]] = function (state) { return Object.assign({}, state, { inviteNewIsPending: true, inviteNewErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_SUCCESS] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_NEW_SUCCESS"]] = function (state) { return Object.assign({}, state, { inviteNewIsPending: false, inviteNewErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_NEW_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_NEW_FAILURE"]] = function (state, action) { return Object.assign({}, state, { inviteNewIsPending: false, inviteNewErrorMessage: action.data.error.message }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_FETCH_FAILURE] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_INVITE_STATUS_FETCH_FAILURE"]] = function (state) { return Object.assign({}, state, { inviteStatusIsPending: false, invitesRemaining: null, @@ -4383,24 +4536,32 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_INVITE_STATUS_F }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_YOUTUBE_IMPORT_STARTED"]] = function (state) { return Object.assign({}, state, { - ytChannelImportPending: true, - ytChannelImportErrorMessage: '' + youtubeChannelImportPending: true, + youtubeChannelImportErrorMessage: '' }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_COMPLETED] = function (state) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_YOUTUBE_IMPORT_SUCCESS"]] = function (state, action) { + var total = action.data.reduce(function (acc, value) { + return acc + value.total_published_videos; + }, 0); + var complete = action.data.reduce(function (acc, value) { + return acc + value.total_transferred; + }, 0); return Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: '' + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '', + youtubeChannelImportTotal: total, + youtubeChannelImportComplete: complete }); }; -reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_FAILURE] = function (state, action) { +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["USER_YOUTUBE_IMPORT_FAILURE"]] = function (state, action) { return Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: action.data + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: action.data }); }; @@ -4413,13 +4574,13 @@ function userReducer() { } /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "costInfoReducer", function() { return costInfoReducer; }); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); var _handleActions; @@ -4455,14 +4616,14 @@ var costInfoReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["hand }), _handleActions), defaultState); /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blacklistReducer", function() { return blacklistReducer; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11); var _handleActions; 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; } @@ -4501,14 +4662,14 @@ var blacklistReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_1__["han }), _handleActions), defaultState); /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filteredReducer", function() { return filteredReducer; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11); var _handleActions; 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; } @@ -4540,13 +4701,13 @@ var filteredReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_1__["hand }), _handleActions), defaultState); /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "homepageReducer", function() { return homepageReducer; }); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); var _handleActions; @@ -4593,13 +4754,13 @@ var homepageReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["hand }), _handleActions), defaultState); /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "statsReducer", function() { return statsReducer; }); -/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var util_redux_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); var _handleActions; @@ -4658,7 +4819,7 @@ var statsReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["handleA }), _handleActions), defaultState); /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4672,6 +4833,7 @@ var defaultState = { syncHash: null, syncData: null, setSyncErrorMessage: null, + getSyncErrorMessage: null, syncApplyErrorMessage: '', syncApplyIsPending: false, getSyncIsPending: false, @@ -4681,7 +4843,8 @@ var defaultState = { reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_STARTED"]] = function (state) { return Object.assign({}, state, { - getSyncIsPending: true + getSyncIsPending: true, + getSyncErrorMessage: null }); }; @@ -4695,6 +4858,13 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_COMPLETED }); }; +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_FAILED"]] = function (state, action) { + return Object.assign({}, state, { + getSyncIsPending: false, + getSyncErrorMessage: action.data.error + }); +}; + reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_STARTED"]] = function (state) { return Object.assign({}, state, { setSyncIsPending: true, @@ -4749,14 +4919,14 @@ function syncReducer() { } /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return selectAuthToken; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return selectIsAuthenticating; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); @@ -4772,7 +4942,7 @@ var selectIsAuthenticating = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["creat }); /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4782,7 +4952,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return makeSelectCostInfoForUri; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return selectFetchingCostInfo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return makeSelectFetchingCostInfoForUri; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4806,14 +4976,14 @@ var makeSelectFetchingCostInfoForUri = function makeSelectFetchingCostInfoForUri }; /***/ }), -/* 39 */ +/* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectState", function() { return selectState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return selectBlackListedOutpoints; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4824,14 +4994,14 @@ var selectBlackListedOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["c }); /***/ }), -/* 40 */ +/* 41 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectState", function() { return selectState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return selectFilteredOutpoints; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4842,7 +5012,7 @@ var selectFilteredOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["crea }); /***/ }), -/* 41 */ +/* 42 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4851,7 +5021,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return selectFetchingFeaturedUris; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return selectTrendingUris; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return selectFetchingTrendingUris; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); @@ -4873,7 +5043,7 @@ var selectFetchingTrendingUris = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["c }); /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4882,9 +5052,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubCount", function() { return selectSubCount; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return makeSelectViewCountForUri; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectSubCountForUri", function() { return makeSelectSubCountForUri; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); @@ -4911,7 +5081,7 @@ var makeSelectSubCountForUri = function makeSelectSubCountForUri(uri) { }; /***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4920,12 +5090,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncHash", function() { return selectSyncHash; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncData", function() { return selectSyncData; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncErrorMessage", function() { return selectSetSyncErrorMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncErrorMessage", function() { return selectGetSyncErrorMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncIsPending", function() { return selectGetSyncIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncIsPending", function() { return selectSetSyncIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return selectHashChanged; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return selectSyncApplyIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return selectSyncApplyErrorMessage; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); @@ -4945,6 +5116,9 @@ var selectSyncData = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelecto var selectSetSyncErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { return state.setSyncErrorMessage; }); +var selectGetSyncErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.getSyncErrorMessage; +}); var selectGetSyncIsPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { return state.getSyncIsPending; }); diff --git a/src/constants/action_types.js b/src/constants/action_types.js index edfbf43..7e0581f 100644 --- a/src/constants/action_types.js +++ b/src/constants/action_types.js @@ -1,7 +1,43 @@ -// Auth Token +// User export const GENERATE_AUTH_TOKEN_FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE'; export const GENERATE_AUTH_TOKEN_STARTED = 'GENERATE_AUTH_TOKEN_STARTED'; export const GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS'; +export const AUTHENTICATION_STARTED = 'AUTHENTICATION_STARTED'; +export const AUTHENTICATION_SUCCESS = 'AUTHENTICATION_SUCCESS'; +export const AUTHENTICATION_FAILURE = 'AUTHENTICATION_FAILURE'; +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_FAILURE = 'USER_EMAIL_NEW_FAILURE'; +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'; +export const USER_EMAIL_VERIFY_FAILURE = 'USER_EMAIL_VERIFY_FAILURE'; +export const USER_EMAIL_VERIFY_RETRY = 'USER_EMAIL_VERIFY_RETRY'; +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'; +export const USER_PHONE_NEW_FAILURE = 'USER_PHONE_NEW_FAILURE'; +export const USER_PHONE_VERIFY_STARTED = 'USER_PHONE_VERIFY_STARTED'; +export const USER_PHONE_VERIFY_SUCCESS = 'USER_PHONE_VERIFY_SUCCESS'; +export const USER_PHONE_VERIFY_FAILURE = 'USER_PHONE_VERIFY_FAILURE'; +export const USER_IDENTITY_VERIFY_STARTED = 'USER_IDENTITY_VERIFY_STARTED'; +export const USER_IDENTITY_VERIFY_SUCCESS = 'USER_IDENTITY_VERIFY_SUCCESS'; +export const USER_IDENTITY_VERIFY_FAILURE = 'USER_IDENTITY_VERIFY_FAILURE'; +export const USER_FETCH_STARTED = 'USER_FETCH_STARTED'; +export const USER_FETCH_SUCCESS = 'USER_FETCH_SUCCESS'; +export const USER_FETCH_FAILURE = 'USER_FETCH_FAILURE'; +export const USER_INVITE_STATUS_FETCH_STARTED = 'USER_INVITE_STATUS_FETCH_STARTED'; +export const USER_INVITE_STATUS_FETCH_SUCCESS = 'USER_INVITE_STATUS_FETCH_SUCCESS'; +export const USER_INVITE_STATUS_FETCH_FAILURE = 'USER_INVITE_STATUS_FETCH_FAILURE'; +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'; // Claims export const FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED'; @@ -82,6 +118,7 @@ export const FETCH_SUB_COUNT_COMPLETED = 'FETCH_SUB_COUNT_COMPLETED'; // Cross-device Sync export const GET_SYNC_STARTED = 'GET_SYNC_STARTED'; export const GET_SYNC_COMPLETED = 'GET_SYNC_COMPLETED'; +export const GET_SYNC_FAILED = 'GET_SYNC_FAILED'; export const SET_SYNC_STARTED = 'SET_SYNC_STARTED'; export const SET_SYNC_FAILED = 'SET_SYNC_FAILED'; export const SET_SYNC_COMPLETED = 'SET_SYNC_COMPLETED'; diff --git a/src/constants/youtube.js b/src/constants/youtube.js new file mode 100644 index 0000000..3701bef --- /dev/null +++ b/src/constants/youtube.js @@ -0,0 +1,3 @@ +export const NOT_TRANSFERRED = 'not_transferred'; +export const PENDING_TRANSFER = 'pending_transfer'; +export const COMPLETED_TRANSFER = 'completed_transfer'; diff --git a/src/index.js b/src/index.js index 32252e9..5907305 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ import * as LBRYINC_ACTIONS from 'constants/action_types'; +import * as YOUTUBE_STATUSES from 'constants/youtube'; import Lbryio from 'lbryio'; import rewards from 'rewards'; import subscriptionsReducer from 'redux/reducers/subscriptions'; @@ -7,7 +8,7 @@ import subscriptionsReducer from 'redux/reducers/subscriptions'; export { userStateSyncMiddleware } from 'redux/middleware/sync'; // constants -export { LBRYINC_ACTIONS }; +export { LBRYINC_ACTIONS, YOUTUBE_STATUSES }; // Lbryio and rewards export { Lbryio, rewards }; @@ -58,6 +59,7 @@ export { doUserIdentityVerify, doUserInviteNew, doClaimYoutubeChannels, + doCheckYoutubeTransfer, } from 'redux/actions/user'; export { doFetchCostInfoForUri } from 'redux/actions/cost_info'; export { doBlackListedOutpointsSubscribe } from 'redux/actions/blacklist'; @@ -153,8 +155,9 @@ export { selectUserInviteReferralLink, selectUserVerifiedEmail, selectYoutubeChannels, - selectYTImportPending, - selectYTImportError, + selectYouTubeImportPending, + selectYouTubeImportError, + selectYouTubeImportVideosComplete, } from 'redux/selectors/user'; export { makeSelectFetchingCostInfoForUri, @@ -176,6 +179,7 @@ export { selectSyncData, selectSyncHash, selectSetSyncErrorMessage, + selectGetSyncErrorMessage, selectGetSyncIsPending, selectSetSyncIsPending, selectSyncApplyIsPending, diff --git a/src/redux/actions/sync.js b/src/redux/actions/sync.js index aa92793..165a9cb 100644 --- a/src/redux/actions/sync.js +++ b/src/redux/actions/sync.js @@ -1,35 +1,6 @@ import * as ACTIONS from 'constants/action_types'; import Lbryio from 'lbryio'; -import { Lbry } from 'lbry-redux'; - -export function doSetSync(oldHash, newHash, data) { - return dispatch => { - dispatch({ - type: ACTIONS.SET_SYNC_STARTED, - }); - - Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post') - .then(response => { - if (!response.hash) { - return dispatch({ - type: ACTIONS.SET_SYNC_FAILED, - data: { error: 'No hash returned for sync/set.' }, - }); - } - - return dispatch({ - type: ACTIONS.SET_SYNC_COMPLETED, - data: { syncHash: response.hash }, - }); - }) - .catch(error => { - dispatch({ - type: ACTIONS.SET_SYNC_FAILED, - data: { error }, - }); - }); - }; -} +import { Lbry, doFetchChannelListMine } from 'lbry-redux'; export function doSetDefaultAccount(success, failure) { return dispatch => { @@ -67,11 +38,9 @@ export function doSetDefaultAccount(success, failure) { failure(err); } }); - } else { + } else if (failure) { // no default account to set - if (failure) { - failure('Could not set a default account'); // fail - } + failure('Could not set a default account'); // fail } }) .catch(err => { @@ -82,45 +51,96 @@ export function doSetDefaultAccount(success, failure) { }; } -export function doGetSync(password) { +export function doSetSync(oldHash, newHash, data, password) { + return dispatch => { + dispatch({ + type: ACTIONS.SET_SYNC_STARTED, + }); + + Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post') + .then(response => { + if (!response.hash) { + return dispatch({ + type: ACTIONS.SET_SYNC_FAILED, + data: { error: 'No hash returned for sync/set.' }, + }); + } + + if (oldHash && newHash !== oldHash) { + dispatch( + doSetDefaultAccount(() => { + if (password !== undefined) { + Lbry.account_unlock({ password }); + dispatch(doFetchChannelListMine()); + } + }) + ); + } + + return dispatch({ + type: ACTIONS.SET_SYNC_COMPLETED, + data: { syncHash: response.hash }, + }); + }) + .catch(error => { + dispatch({ + type: ACTIONS.SET_SYNC_FAILED, + data: { error }, + }); + }); + }; +} + +export function doGetSync(password = '') { return dispatch => { dispatch({ type: ACTIONS.GET_SYNC_STARTED, }); + const data = {}; Lbry.sync_hash().then(hash => { Lbryio.call('sync', 'get', { hash }, 'post') .then(response => { - const data = { hasSyncedWallet: true }; - if (response.changed) { - const syncHash = response.hash; - data.syncHash = syncHash; - data.syncData = response.data; + const syncHash = response.hash; + data.syncHash = syncHash; + data.syncData = response.data; + data.hasSyncedWallet = true; - Lbry.sync_apply({ password, data: response.data }).then( + if (response.changed) { + return Lbry.sync_apply({ password, data: response.data }).then( ({ hash: walletHash, data: walletData }) => { + dispatch({ type: ACTIONS.GET_SYNC_COMPLETED, data }); + if (walletHash !== syncHash) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData)); + dispatch(doSetSync(syncHash, walletHash, walletData, password)); } } ); } - dispatch({ type: ACTIONS.GET_SYNC_COMPLETED, data }); }) .catch(() => { - // user doesn't have a synced wallet - dispatch({ - type: ACTIONS.GET_SYNC_COMPLETED, - data: { hasSyncedWallet: false, syncHash: null }, - }); + if (data.hasSyncedWallet) { + dispatch({ + type: ACTIONS.GET_SYNC_FAILED, + data: { + error: 'Error getting synced wallet', + }, + }); + } else { + // user doesn't have a synced wallet + dispatch({ + type: ACTIONS.GET_SYNC_COMPLETED, + data: { hasSyncedWallet: false, syncHash: null }, + }); - // call sync_apply to get data to sync - // first time sync. use any string for old hash - Lbry.sync_apply({ password }).then(({ hash: walletHash, data }) => - dispatch(doSetSync('', walletHash, data)) - ); + // call sync_apply to get data to sync + // first time sync. use any string for old hash + Lbry.sync_apply({ password }).then(({ hash: walletHash, data: syncApplyData }) => + dispatch(doSetSync('', walletHash, syncApplyData, password)) + ); + } }); }); }; diff --git a/src/redux/actions/user.js b/src/redux/actions/user.js index 4be3be2..8905eeb 100644 --- a/src/redux/actions/user.js +++ b/src/redux/actions/user.js @@ -1,4 +1,5 @@ -import { ACTIONS, Lbry, doToast, doFetchChannelListMine, batchActions } from 'lbry-redux'; +import { Lbry, doToast, doFetchChannelListMine, batchActions } from 'lbry-redux'; +import * as ACTIONS from 'constants/action_types'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; import { selectEmailToVerify, @@ -84,9 +85,7 @@ export function doUserFetch() { }); Lbryio.getCurrentUser() .then(user => { - // analytics.setUser(user); dispatch(doRewardList()); - dispatch({ type: ACTIONS.USER_FETCH_SUCCESS, data: { user }, @@ -388,15 +387,18 @@ export function doClaimYoutubeChannels() { dispatch({ type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED, }); - Lbry.address_list() + + let transferResponse; + return Lbry.address_list() .then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0]) .then(address => Lbryio.call('yt', 'transfer', { address: address.address, public_key: address.pubkey, }).then(response => { - if (response && response.success) { - Promise.all( + if (response && response.length) { + transferResponse = response; + return Promise.all( response.map(channelMeta => { if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return Lbry.channel_import({ @@ -408,7 +410,8 @@ export function doClaimYoutubeChannels() { ).then(() => { const actions = [ { - type: ACTIONS.USER_YOUTUBE_IMPORT_COMPLETED, + type: ACTIONS.USER_YOUTUBE_IMPORT_SUCCESS, + data: transferResponse, }, ]; actions.push(doUserFetch()); @@ -426,3 +429,29 @@ export function doClaimYoutubeChannels() { }); }; } + +export function doCheckYoutubeTransfer() { + return dispatch => { + dispatch({ + type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED, + }); + + return Lbryio.call('yt', 'transfer') + .then(response => { + if (response && response.length) { + dispatch({ + type: ACTIONS.USER_YOUTUBE_IMPORT_SUCCESS, + data: response, + }); + } else { + throw new Error(); + } + }) + .catch(error => { + dispatch({ + type: ACTIONS.USER_YOUTUBE_IMPORT_FAILURE, + data: String(error), + }); + }); + }; +} diff --git a/src/redux/reducers/sync.js b/src/redux/reducers/sync.js index c571489..725e59c 100644 --- a/src/redux/reducers/sync.js +++ b/src/redux/reducers/sync.js @@ -6,6 +6,7 @@ const defaultState = { syncHash: null, syncData: null, setSyncErrorMessage: null, + getSyncErrorMessage: null, syncApplyErrorMessage: '', syncApplyIsPending: false, getSyncIsPending: false, @@ -16,6 +17,7 @@ const defaultState = { reducers[ACTIONS.GET_SYNC_STARTED] = state => Object.assign({}, state, { getSyncIsPending: true, + getSyncErrorMessage: null, }); reducers[ACTIONS.GET_SYNC_COMPLETED] = (state, action) => @@ -27,6 +29,12 @@ reducers[ACTIONS.GET_SYNC_COMPLETED] = (state, action) => hashChanged: action.data.hashChanged, }); +reducers[ACTIONS.GET_SYNC_FAILED] = (state, action) => + Object.assign({}, state, { + getSyncIsPending: false, + getSyncErrorMessage: action.data.error, + }); + reducers[ACTIONS.SET_SYNC_STARTED] = state => Object.assign({}, state, { setSyncIsPending: true, diff --git a/src/redux/reducers/user.js b/src/redux/reducers/user.js index 250c4ff..8072bfc 100644 --- a/src/redux/reducers/user.js +++ b/src/redux/reducers/user.js @@ -1,4 +1,4 @@ -import { ACTIONS } from 'lbry-redux'; +import * as ACTIONS from 'constants/action_types'; const reducers = {}; @@ -14,8 +14,8 @@ const defaultState = { invitesRemaining: undefined, invitees: undefined, user: undefined, - ytChannelImportPending: false, - ytChannelImportErrorMessage: '', + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '', }; reducers[ACTIONS.AUTHENTICATION_STARTED] = state => @@ -225,20 +225,27 @@ reducers[ACTIONS.USER_INVITE_STATUS_FETCH_FAILURE] = state => reducers[ACTIONS.USER_YOUTUBE_IMPORT_STARTED] = state => Object.assign({}, state, { - ytChannelImportPending: true, - ytChannelImportErrorMessage: '', + youtubeChannelImportPending: true, + youtubeChannelImportErrorMessage: '', }); -reducers[ACTIONS.USER_YOUTUBE_IMPORT_COMPLETED] = state => - Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: '', +reducers[ACTIONS.USER_YOUTUBE_IMPORT_SUCCESS] = (state, action) => { + const total = action.data.reduce((acc, value) => acc + value.total_published_videos, 0); + + const complete = action.data.reduce((acc, value) => acc + value.total_transferred, 0); + + return Object.assign({}, state, { + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: '', + youtubeChannelImportTotal: total, + youtubeChannelImportComplete: complete, }); +}; reducers[ACTIONS.USER_YOUTUBE_IMPORT_FAILURE] = (state, action) => Object.assign({}, state, { - ytChannelImportPending: false, - ytChannelImportErrorMessage: action.data, + youtubeChannelImportPending: false, + youtubeChannelImportErrorMessage: action.data, }); export function userReducer(state = defaultState, action) { diff --git a/src/redux/selectors/sync.js b/src/redux/selectors/sync.js index 01f7a1b..811e025 100644 --- a/src/redux/selectors/sync.js +++ b/src/redux/selectors/sync.js @@ -13,6 +13,11 @@ export const selectSetSyncErrorMessage = createSelector( state => state.setSyncErrorMessage ); +export const selectGetSyncErrorMessage = createSelector( + selectState, + state => state.getSyncErrorMessage +); + export const selectGetSyncIsPending = createSelector(selectState, state => state.getSyncIsPending); export const selectSetSyncIsPending = createSelector(selectState, state => state.setSyncIsPending); diff --git a/src/redux/selectors/user.js b/src/redux/selectors/user.js index 42da98e..b2b4165 100644 --- a/src/redux/selectors/user.js +++ b/src/redux/selectors/user.js @@ -142,12 +142,21 @@ export const selectUserInviteReferralLink = createSelector( state => state.referralLink ); -export const selectYTImportPending = createSelector( +export const selectYouTubeImportPending = createSelector( selectState, - state => state.ytChannelImportPending + state => state.youtubeChannelImportPending ); -export const selectYTImportError = createSelector( +export const selectYouTubeImportError = createSelector( selectState, - state => state.ytChannelImportErrorMessage + state => state.youtubeChannelImportErrorMessage ); + +export const selectYouTubeImportVideosComplete = createSelector(selectState, state => { + const total = state.youtubeChannelImportTotal; + const complete = state.youtubeChannelImportComplete || 0; + + if (total) { + return [complete, total]; + } +}); -- 2.45.2 From 5aba3127c879f5aaa9b1eccaf57aae97449df183 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 2 Oct 2019 16:22:51 -0400 Subject: [PATCH 2/5] update balance after claiming reward and add action for clearing sync state --- dist/bundle.es.js | 51 ++++++++++++++++++++------------ dist/bundle.js | 55 ++++++++++++++++++++++++----------- src/constants/action_types.js | 1 + src/index.js | 1 + src/redux/actions/rewards.js | 44 +++++++++++++++------------- src/redux/actions/sync.js | 8 +++++ src/redux/reducers/sync.js | 2 ++ 7 files changed, 106 insertions(+), 56 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index ab72001..5e1f2a9 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -127,6 +127,7 @@ const SET_DEFAULT_ACCOUNT = 'SET_DEFAULT_ACCOUNT'; const SYNC_APPLY_STARTED = 'SYNC_APPLY_STARTED'; const SYNC_APPLY_COMPLETED = 'SYNC_APPLY_COMPLETED'; const SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; +const SYNC_RESET = 'SYNC_RESET'; var action_types = /*#__PURE__*/Object.freeze({ GENERATE_AUTH_TOKEN_FAILURE: GENERATE_AUTH_TOKEN_FAILURE, @@ -239,7 +240,8 @@ var action_types = /*#__PURE__*/Object.freeze({ SET_DEFAULT_ACCOUNT: SET_DEFAULT_ACCOUNT, SYNC_APPLY_STARTED: SYNC_APPLY_STARTED, SYNC_APPLY_COMPLETED: SYNC_APPLY_COMPLETED, - SYNC_APPLY_FAILED: SYNC_APPLY_FAILED + SYNC_APPLY_FAILED: SYNC_APPLY_FAILED, + SYNC_RESET: SYNC_RESET }); const NOT_TRANSFERRED = 'not_transferred'; @@ -1624,24 +1626,26 @@ function doClaimRewardType(rewardType, options = {}) { }); const success = successReward => { - dispatch({ - type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS, - data: { - reward: successReward + dispatch(lbryRedux.doUpdateBalance()).then(() => { + dispatch({ + type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS, + data: { + reward: successReward + } + }); + + if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { + rewards.callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { + dispatch(doFetchInviteStatus()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); } }); - - if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { - rewards.callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { - dispatch(doFetchInviteStatus()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } }; const failure = error => { @@ -1665,7 +1669,7 @@ function doClaimRewardType(rewardType, options = {}) { } }; - rewards.claimReward(rewardType, params).then(success, failure); + return rewards.claimReward(rewardType, params).then(success, failure); }; } function doClaimEligiblePurchaseRewards() { @@ -2545,6 +2549,14 @@ function doCheckSync() { }); }; } +function doResetSync() { + return dispatch => new Promise(resolve => { + dispatch({ + type: SYNC_RESET + }); + resolve(); + }); +} const reducers = {}; const defaultState$1 = { @@ -3155,6 +3167,8 @@ reducers$3[SYNC_APPLY_FAILED] = (state, action) => Object.assign({}, state, { syncApplyErrorMessage: action.data.error }); +reducers$3[SYNC_RESET] = () => defaultState$9; + function syncReducer(state = defaultState$9, action) { const handler = reducers$3[action.type]; if (handler) return handler(state, action); @@ -3243,6 +3257,7 @@ exports.doGetSync = doGetSync; exports.doInstallNew = doInstallNew; exports.doRemoveUnreadSubscription = doRemoveUnreadSubscription; exports.doRemoveUnreadSubscriptions = doRemoveUnreadSubscriptions; +exports.doResetSync = doResetSync; exports.doRewardList = doRewardList; exports.doSetDefaultAccount = doSetDefaultAccount; exports.doSetSync = doSetSync; diff --git a/dist/bundle.js b/dist/bundle.js index 9fc2999..1c8de80 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -232,6 +232,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doSyncApply"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doResetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_15__["doResetSync"]; }); + /* harmony import */ var redux_reducers_auth__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "authReducer", function() { return redux_reducers_auth__WEBPACK_IMPORTED_MODULE_16__["authReducer"]; }); @@ -609,6 +611,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_STARTED", function() { return SYNC_APPLY_STARTED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_COMPLETED", function() { return SYNC_APPLY_COMPLETED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_APPLY_FAILED", function() { return SYNC_APPLY_FAILED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYNC_RESET", function() { return SYNC_RESET; }); // User var GENERATE_AUTH_TOKEN_FAILURE = 'GENERATE_AUTH_TOKEN_FAILURE'; var GENERATE_AUTH_TOKEN_STARTED = 'GENERATE_AUTH_TOKEN_STARTED'; @@ -728,6 +731,7 @@ var SET_DEFAULT_ACCOUNT = 'SET_DEFAULT_ACCOUNT'; var SYNC_APPLY_STARTED = 'SYNC_APPLY_STARTED'; var SYNC_APPLY_COMPLETED = 'SYNC_APPLY_COMPLETED'; var SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; +var SYNC_RESET = 'SYNC_RESET'; /***/ }), /* 2 */ @@ -2182,24 +2186,26 @@ function doClaimRewardType(rewardType) { }); var success = function success(successReward) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, - data: { - reward: successReward + dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, + data: { + reward: successReward + } + }); + + if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { + rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { + dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); } }); - - if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { - dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } }; var failure = function failure(error) { @@ -2223,7 +2229,7 @@ function doClaimRewardType(rewardType) { } }; - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].claimReward(rewardType, params).then(success, failure); + return rewards__WEBPACK_IMPORTED_MODULE_5__["default"].claimReward(rewardType, params).then(success, failure); }; } function doClaimEligiblePurchaseRewards() { @@ -3874,6 +3880,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return doGetSync; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return doSyncApply; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return doCheckSync; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doResetSync", function() { return doResetSync; }); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); @@ -4105,6 +4112,16 @@ function doCheckSync() { }); }; } +function doResetSync() { + return function (dispatch) { + return new Promise(function (resolve) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SYNC_RESET"] + }); + resolve(); + }); + }; +} /***/ }), /* 29 */ @@ -4910,6 +4927,10 @@ reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SYNC_APPLY_FAILED" }); }; +reducers[constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SYNC_RESET"]] = function () { + return defaultState; +}; + function syncReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState; var action = arguments.length > 1 ? arguments[1] : undefined; diff --git a/src/constants/action_types.js b/src/constants/action_types.js index 7e0581f..3a91dc7 100644 --- a/src/constants/action_types.js +++ b/src/constants/action_types.js @@ -126,3 +126,4 @@ export const SET_DEFAULT_ACCOUNT = 'SET_DEFAULT_ACCOUNT'; export const SYNC_APPLY_STARTED = 'SYNC_APPLY_STARTED'; export const SYNC_APPLY_COMPLETED = 'SYNC_APPLY_COMPLETED'; export const SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; +export const SYNC_RESET = 'SYNC_RESET'; diff --git a/src/index.js b/src/index.js index 5907305..670841c 100644 --- a/src/index.js +++ b/src/index.js @@ -72,6 +72,7 @@ export { doSetSync, doSetDefaultAccount, doSyncApply, + doResetSync, } from 'redux/actions/sync'; // reducers diff --git a/src/redux/actions/rewards.js b/src/redux/actions/rewards.js index 331d1bf..68dd49a 100644 --- a/src/redux/actions/rewards.js +++ b/src/redux/actions/rewards.js @@ -1,5 +1,5 @@ import Lbryio from 'lbryio'; -import { ACTIONS, doToast } from 'lbry-redux'; +import { ACTIONS, doToast, doUpdateBalance } from 'lbry-redux'; import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { selectUserIsRewardApproved } from 'redux/selectors/user'; import { doFetchInviteStatus } from 'redux/actions/user'; @@ -71,26 +71,28 @@ export function doClaimRewardType(rewardType, options = {}) { }); const success = successReward => { - dispatch({ - type: ACTIONS.CLAIM_REWARD_SUCCESS, - data: { - reward: successReward, - }, + dispatch(doUpdateBalance()).then(() => { + dispatch({ + type: ACTIONS.CLAIM_REWARD_SUCCESS, + data: { + reward: successReward, + }, + }); + if ( + successReward.reward_type === rewards.TYPE_NEW_USER && + rewards.callbacks.claimFirstRewardSuccess + ) { + rewards.callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { + dispatch(doFetchInviteStatus()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); + } }); - if ( - successReward.reward_type === rewards.TYPE_NEW_USER && - rewards.callbacks.claimFirstRewardSuccess - ) { - rewards.callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { - dispatch(doFetchInviteStatus()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } }; const failure = error => { @@ -111,7 +113,7 @@ export function doClaimRewardType(rewardType, options = {}) { } }; - rewards.claimReward(rewardType, params).then(success, failure); + return rewards.claimReward(rewardType, params).then(success, failure); }; } diff --git a/src/redux/actions/sync.js b/src/redux/actions/sync.js index 165a9cb..6630a0c 100644 --- a/src/redux/actions/sync.js +++ b/src/redux/actions/sync.js @@ -202,3 +202,11 @@ export function doCheckSync() { }); }; } + +export function doResetSync() { + return dispatch => + new Promise(resolve => { + dispatch({ type: ACTIONS.SYNC_RESET }); + resolve(); + }); +} diff --git a/src/redux/reducers/sync.js b/src/redux/reducers/sync.js index 725e59c..47ca138 100644 --- a/src/redux/reducers/sync.js +++ b/src/redux/reducers/sync.js @@ -73,6 +73,8 @@ reducers[ACTIONS.SYNC_APPLY_FAILED] = (state, action) => syncApplyErrorMessage: action.data.error, }); +reducers[ACTIONS.SYNC_RESET] = () => defaultState; + export function syncReducer(state = defaultState, action) { const handler = reducers[action.type]; if (handler) return handler(state, action); -- 2.45.2 From 44b6373ada13299a0fba1e60ac508f485af75388 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 3 Oct 2019 13:14:17 -0400 Subject: [PATCH 3/5] wait to call account_balance to ensure sdk returns proper balance after claiming a reward --- dist/bundle.es.js | 39 ++++++++++++++++--------------- dist/bundle.js | 39 ++++++++++++++++--------------- src/redux/actions/rewards.js | 45 +++++++++++++++++++----------------- 3 files changed, 66 insertions(+), 57 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 5e1f2a9..685ee73 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1626,26 +1626,29 @@ function doClaimRewardType(rewardType, options = {}) { }); const success = successReward => { - dispatch(lbryRedux.doUpdateBalance()).then(() => { - dispatch({ - type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS, - data: { - reward: successReward + // Temporary timeout to ensure the sdk has the correct balance after claiming a reward + setTimeout(() => { + dispatch(lbryRedux.doUpdateBalance()).then(() => { + dispatch({ + type: lbryRedux.ACTIONS.CLAIM_REWARD_SUCCESS, + data: { + reward: successReward + } + }); + + if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { + rewards.callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { + dispatch(doFetchInviteStatus()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); } }); - - if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { - rewards.callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { - dispatch(doFetchInviteStatus()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } - }); + }, 1000); }; const failure = error => { diff --git a/dist/bundle.js b/dist/bundle.js index 1c8de80..075c30b 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -2186,26 +2186,29 @@ function doClaimRewardType(rewardType) { }); var success = function success(successReward) { - dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, - data: { - reward: successReward + // Temporary timeout to ensure the sdk has the correct balance after claiming a reward + setTimeout(function () { + dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doUpdateBalance"])()).then(function () { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, + data: { + reward: successReward + } + }); + + if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { + rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { + dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); } }); - - if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { - dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } - }); + }, 1000); }; var failure = function failure(error) { diff --git a/src/redux/actions/rewards.js b/src/redux/actions/rewards.js index 68dd49a..ada21fd 100644 --- a/src/redux/actions/rewards.js +++ b/src/redux/actions/rewards.js @@ -71,28 +71,31 @@ export function doClaimRewardType(rewardType, options = {}) { }); const success = successReward => { - dispatch(doUpdateBalance()).then(() => { - dispatch({ - type: ACTIONS.CLAIM_REWARD_SUCCESS, - data: { - reward: successReward, - }, + // Temporary timeout to ensure the sdk has the correct balance after claiming a reward + setTimeout(() => { + dispatch(doUpdateBalance()).then(() => { + dispatch({ + type: ACTIONS.CLAIM_REWARD_SUCCESS, + data: { + reward: successReward, + }, + }); + if ( + successReward.reward_type === rewards.TYPE_NEW_USER && + rewards.callbacks.claimFirstRewardSuccess + ) { + rewards.callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { + dispatch(doFetchInviteStatus()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); + } }); - if ( - successReward.reward_type === rewards.TYPE_NEW_USER && - rewards.callbacks.claimFirstRewardSuccess - ) { - rewards.callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { - dispatch(doFetchInviteStatus()); - } - - dispatch(doRewardList()); - - if (options.callback) { - options.callback(); - } - }); + }, 1000); }; const failure = error => { -- 2.45.2 From 11205c53383e73ed1283e33fe16be9f3b6fe1d14 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 3 Oct 2019 15:05:42 -0400 Subject: [PATCH 4/5] update link instructions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8097c21..0c065a9 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Add `lbryinc` as a dependency to your `package.json` file. If you intend to make changes to the module and test immediately, you can use `npm link` to add the package to your `node_modules` folder. This will create a symlink to the folder where `lbry-redux` was cloned to. ``` cd lbryinc -sudo npm link -cd ////node_modules -npm link lbryinc +yarn link +cd /// (ex: cd ~/lbry-desktop) +yarn link lbryinc ```` ### Build -- 2.45.2 From d1dba98bb6f1dc67bc0db4c0a20fc13b8a0de98b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 4 Oct 2019 12:52:28 -0400 Subject: [PATCH 5/5] require flag to set the default account after calling getSync --- dist/bundle.es.js | 44 +++++++++++++++++++-------------------- dist/bundle.js | 43 +++++++++++++++++++------------------- src/redux/actions/sync.js | 43 +++++++++++++++++++------------------- 3 files changed, 63 insertions(+), 67 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 685ee73..20bfdb0 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2375,34 +2375,18 @@ function doSetDefaultAccount(success, failure) { }); }; } -function doSetSync(oldHash, newHash, data, password) { +function doSetSync(oldHash, newHash, data) { return dispatch => { dispatch({ type: SET_SYNC_STARTED }); - Lbryio.call('sync', 'set', { + return Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post').then(response => { if (!response.hash) { - return dispatch({ - type: SET_SYNC_FAILED, - data: { - error: 'No hash returned for sync/set.' - } - }); - } - - if (oldHash && newHash !== oldHash) { - dispatch(doSetDefaultAccount(() => { - if (password !== undefined) { - lbryRedux.Lbry.account_unlock({ - password - }); - dispatch(lbryRedux.doFetchChannelListMine()); - } - })); + throw Error('No hash returned for sync/set.'); } return dispatch({ @@ -2421,7 +2405,7 @@ function doSetSync(oldHash, newHash, data, password) { }); }; } -function doGetSync(password = '') { +function doGetSync(password = '', shouldSetDefaultAccount) { return dispatch => { dispatch({ type: GET_SYNC_STARTED @@ -2436,7 +2420,7 @@ function doGetSync(password = '') { data.syncData = response.data; data.hasSyncedWallet = true; - if (response.changed) { + if (response.changed || shouldSetDefaultAccount) { return lbryRedux.Lbry.sync_apply({ password, data: response.data @@ -2449,9 +2433,23 @@ function doGetSync(password = '') { data }); - if (walletHash !== syncHash) { + if (walletHash !== syncHash || shouldSetDefaultAccount) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData, password)); + dispatch(doSetSync(syncHash, walletHash, walletData)); + + if (shouldSetDefaultAccount) { + dispatch(doSetDefaultAccount(() => { + lbryRedux.Lbry.status().then(status => { + if (status.wallet.is_locked) { + lbryRedux.Lbry.account_unlock({ + password + }); + } + + dispatch(lbryRedux.doFetchChannelListMine()); + }); + })); + } } }); } diff --git a/dist/bundle.js b/dist/bundle.js index 075c30b..c440d5f 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -3938,34 +3938,18 @@ function doSetDefaultAccount(success, failure) { }); }; } -function doSetSync(oldHash, newHash, data, password) { +function doSetSync(oldHash, newHash, data) { return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_STARTED"] }); - lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('sync', 'set', { + return lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data: data }, 'post').then(function (response) { if (!response.hash) { - return dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["SET_SYNC_FAILED"], - data: { - error: 'No hash returned for sync/set.' - } - }); - } - - if (oldHash && newHash !== oldHash) { - dispatch(doSetDefaultAccount(function () { - if (password !== undefined) { - lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].account_unlock({ - password: password - }); - dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["doFetchChannelListMine"])()); - } - })); + throw Error('No hash returned for sync/set.'); } return dispatch({ @@ -3986,6 +3970,7 @@ function doSetSync(oldHash, newHash, data, password) { } function doGetSync() { var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var shouldSetDefaultAccount = arguments.length > 1 ? arguments[1] : undefined; return function (dispatch) { dispatch({ type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GET_SYNC_STARTED"] @@ -4000,7 +3985,7 @@ function doGetSync() { data.syncData = response.data; data.hasSyncedWallet = true; - if (response.changed) { + if (response.changed || shouldSetDefaultAccount) { return lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].sync_apply({ password: password, data: response.data @@ -4012,9 +3997,23 @@ function doGetSync() { data: data }); - if (walletHash !== syncHash) { + if (walletHash !== syncHash || shouldSetDefaultAccount) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData, password)); + dispatch(doSetSync(syncHash, walletHash, walletData)); + + if (shouldSetDefaultAccount) { + dispatch(doSetDefaultAccount(function () { + lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].status().then(function (status) { + if (status.wallet.is_locked) { + lbry_redux__WEBPACK_IMPORTED_MODULE_2__["Lbry"].account_unlock({ + password: password + }); + } + + dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["doFetchChannelListMine"])()); + }); + })); + } } }); } diff --git a/src/redux/actions/sync.js b/src/redux/actions/sync.js index 6630a0c..d456dc4 100644 --- a/src/redux/actions/sync.js +++ b/src/redux/actions/sync.js @@ -51,30 +51,16 @@ export function doSetDefaultAccount(success, failure) { }; } -export function doSetSync(oldHash, newHash, data, password) { +export function doSetSync(oldHash, newHash, data) { return dispatch => { dispatch({ type: ACTIONS.SET_SYNC_STARTED, }); - Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post') + return Lbryio.call('sync', 'set', { old_hash: oldHash, new_hash: newHash, data }, 'post') .then(response => { if (!response.hash) { - return dispatch({ - type: ACTIONS.SET_SYNC_FAILED, - data: { error: 'No hash returned for sync/set.' }, - }); - } - - if (oldHash && newHash !== oldHash) { - dispatch( - doSetDefaultAccount(() => { - if (password !== undefined) { - Lbry.account_unlock({ password }); - dispatch(doFetchChannelListMine()); - } - }) - ); + throw Error('No hash returned for sync/set.'); } return dispatch({ @@ -91,7 +77,7 @@ export function doSetSync(oldHash, newHash, data, password) { }; } -export function doGetSync(password = '') { +export function doGetSync(password = '', shouldSetDefaultAccount) { return dispatch => { dispatch({ type: ACTIONS.GET_SYNC_STARTED, @@ -105,19 +91,32 @@ export function doGetSync(password = '') { data.syncHash = syncHash; data.syncData = response.data; data.hasSyncedWallet = true; - - if (response.changed) { + if (response.changed || shouldSetDefaultAccount) { return Lbry.sync_apply({ password, data: response.data }).then( ({ hash: walletHash, data: walletData }) => { dispatch({ type: ACTIONS.GET_SYNC_COMPLETED, data }); - if (walletHash !== syncHash) { + if (walletHash !== syncHash || shouldSetDefaultAccount) { // different local hash, need to synchronise - dispatch(doSetSync(syncHash, walletHash, walletData, password)); + dispatch(doSetSync(syncHash, walletHash, walletData)); + + if (shouldSetDefaultAccount) { + dispatch( + doSetDefaultAccount(() => { + Lbry.status().then(status => { + if (status.wallet.is_locked) { + Lbry.account_unlock({ password }); + } + dispatch(doFetchChannelListMine()); + }); + }) + ); + } } } ); } + dispatch({ type: ACTIONS.GET_SYNC_COMPLETED, data }); }) .catch(() => { -- 2.45.2