diff --git a/src/renderer/component/rewardSummary/index.js b/src/renderer/component/rewardSummary/index.js index 8aaea1384..9afb3f8ef 100644 --- a/src/renderer/component/rewardSummary/index.js +++ b/src/renderer/component/rewardSummary/index.js @@ -1,6 +1,10 @@ import { connect } from 'react-redux'; -import { selectUnclaimedRewardValue, selectFetchingRewards, doRewardList } from 'lbryinc'; -import { doFetchRewardedContent } from 'redux/actions/content'; +import { + selectUnclaimedRewardValue, + selectFetchingRewards, + doRewardList, + doFetchRewardedContent, +} from 'lbryinc'; import RewardSummary from './view'; const select = state => ({ diff --git a/src/renderer/page/discover/index.js b/src/renderer/page/discover/index.js index 6a35f0029..0d4d8b017 100644 --- a/src/renderer/page/discover/index.js +++ b/src/renderer/page/discover/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; -import { doFetchFeaturedUris, doFetchRewardedContent } from 'redux/actions/content'; -import { selectFeaturedUris, selectFetchingFeaturedUris } from 'redux/selectors/content'; +import { selectFeaturedUris, selectFetchingFeaturedUris, doFetchFeaturedUris } from 'lbry-redux'; +import { doFetchRewardedContent } from 'lbryinc'; import DiscoverPage from './view'; const select = state => ({ diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index c41702b4e..61e5b42f0 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -13,7 +13,6 @@ import { doHideNotification, } from 'lbry-redux'; import Native from 'native'; -import { doFetchRewardedContent } from 'redux/actions/content'; import { doFetchDaemonSettings } from 'redux/actions/settings'; import { doAuthNavigate } from 'redux/actions/navigation'; import { doCheckSubscriptionsInit } from 'redux/actions/subscriptions'; @@ -27,7 +26,7 @@ import { selectRemoteVersion, selectUpgradeTimer, } from 'redux/selectors/app'; -import { doAuthenticate } from 'lbryinc'; +import { doAuthenticate, doFetchRewardedContent } from 'lbryinc'; import { lbrySettings as config, version as appVersion } from 'package.json'; const { autoUpdater } = remote.require('electron-updater'); diff --git a/src/renderer/redux/actions/content.js b/src/renderer/redux/actions/content.js index 071db143f..0826e4878 100644 --- a/src/renderer/redux/actions/content.js +++ b/src/renderer/redux/actions/content.js @@ -15,8 +15,6 @@ import { Lbry, Lbryapi, buildURI, - batchActions, - doResolveUris, doFetchClaimListMine, makeSelectCostInfoForUri, makeSelectFileInfoForUri, @@ -30,74 +28,9 @@ import { makeSelectClientSetting, selectosNotificationsEnabled } from 'redux/sel import setBadge from 'util/setBadge'; import setProgressBar from 'util/setProgressBar'; import analytics from 'analytics'; -import { Lbryio } from 'lbryinc'; const DOWNLOAD_POLL_INTERVAL = 250; -export function doFetchFeaturedUris() { - return dispatch => { - dispatch({ - type: ACTIONS.FETCH_FEATURED_CONTENT_STARTED, - }); - - const success = ({ Uris }) => { - const urisToResolve = Object.keys(Uris).reduce( - (resolve, category) => [...resolve, ...Uris[category]], - [] - ); - - const actions = [ - doResolveUris(urisToResolve), - { - type: ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED, - data: { - uris: Uris, - success: true, - }, - }, - ]; - dispatch(batchActions(...actions)); - }; - - const failure = () => { - dispatch({ - type: ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED, - data: { - uris: {}, - }, - }); - }; - - Lbryio.call('file', 'list_homepage').then(success, failure); - }; -} - -export function doFetchRewardedContent() { - return dispatch => { - const success = nameToClaimId => { - dispatch({ - type: ACTIONS.FETCH_REWARD_CONTENT_COMPLETED, - data: { - claimIds: Object.values(nameToClaimId), - success: true, - }, - }); - }; - - const failure = () => { - dispatch({ - type: ACTIONS.FETCH_REWARD_CONTENT_COMPLETED, - data: { - claimIds: [], - success: false, - }, - }); - }; - - Lbryio.call('reward', 'list_featured').then(success, failure); - }; -} - export function doUpdateLoadStatus(uri, outpoint) { return (dispatch, getState) => { Lbry.file_list({ diff --git a/src/renderer/redux/selectors/content.js b/src/renderer/redux/selectors/content.js index f5cc1a7b2..bfeec666c 100644 --- a/src/renderer/redux/selectors/content.js +++ b/src/renderer/redux/selectors/content.js @@ -4,13 +4,6 @@ import { HISTORY_ITEMS_PER_PAGE } from 'constants/content'; export const selectState = state => state.content || {}; -export const selectFeaturedUris = createSelector(selectState, state => state.featuredUris); - -export const selectFetchingFeaturedUris = createSelector( - selectState, - state => state.fetchingFeaturedContent -); - export const selectPlayingUri = createSelector(selectState, state => state.playingUri); export const selectChannelClaimCounts = createSelector(