From e618b491e6b65b3792005aa7df9a732d12afac6e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 27 Nov 2018 10:49:54 -0500 Subject: [PATCH] remove fetchClaimsCount call on channel pages --- src/renderer/page/channel/index.js | 3 +- src/renderer/page/channel/view.jsx | 10 ++----- src/renderer/redux/actions/content.js | 41 --------------------------- 3 files changed, 3 insertions(+), 51 deletions(-) diff --git a/src/renderer/page/channel/index.js b/src/renderer/page/channel/index.js index 51960e19c..7b4327180 100644 --- a/src/renderer/page/channel/index.js +++ b/src/renderer/page/channel/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { doFetchClaimsByChannel, doFetchClaimCountByChannel } from 'redux/actions/content'; +import { doFetchClaimsByChannel } from 'redux/actions/content'; import { PAGE_SIZE } from 'constants/claim'; import { makeSelectClaimForUri, @@ -26,7 +26,6 @@ const select = (state, props) => ({ const perform = dispatch => ({ fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)), - fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)), navigate: (path, params) => dispatch(doNavigate(path, params)), openModal: (modal, props) => dispatch(doOpenModal(modal, props)), }); diff --git a/src/renderer/page/channel/view.jsx b/src/renderer/page/channel/view.jsx index ac22be359..d61a01fa9 100644 --- a/src/renderer/page/channel/view.jsx +++ b/src/renderer/page/channel/view.jsx @@ -22,28 +22,22 @@ type Props = { claimsInChannel: Array, channelIsMine: boolean, fetchClaims: (string, number) => void, - fetchClaimCount: string => void, navigate: (string, {}) => void, openModal: ({ id: string }, { uri: string }) => void, }; class ChannelPage extends React.PureComponent { componentDidMount() { - const { uri, page, fetchClaims, fetchClaimCount } = this.props; - + const { uri, page, fetchClaims } = this.props; fetchClaims(uri, page || 1); - fetchClaimCount(uri); } componentWillReceiveProps(nextProps: Props) { - const { page, uri, fetchClaims, fetchClaimCount } = this.props; + const { page, fetchClaims } = this.props; if (nextProps.page && page !== nextProps.page) { fetchClaims(nextProps.uri, nextProps.page); } - if (nextProps.uri !== uri) { - fetchClaimCount(uri); - } } changePage(pageNumber: number) { diff --git a/src/renderer/redux/actions/content.js b/src/renderer/redux/actions/content.js index 8a76e8213..083518ca6 100644 --- a/src/renderer/redux/actions/content.js +++ b/src/renderer/redux/actions/content.js @@ -14,7 +14,6 @@ import { Lbry, Lbryapi, buildURI, - doFetchClaimListMine, makeSelectCostInfoForUri, makeSelectFileInfoForUri, selectFileInfosByOutpoint, @@ -331,28 +330,6 @@ export function doFetchClaimsByChannel(uri, page, pageSize) { }; } -export function doFetchClaimCountByChannel(uri) { - return dispatch => { - dispatch({ - type: ACTIONS.FETCH_CHANNEL_CLAIM_COUNT_STARTED, - data: { uri }, - }); - - Lbry.claim_list_by_channel({ uri }).then(result => { - const claimResult = result[uri]; - const totalClaims = claimResult ? claimResult.claims_in_channel : 0; - - dispatch({ - type: ACTIONS.FETCH_CHANNEL_CLAIM_COUNT_COMPLETED, - data: { - uri, - totalClaims, - }, - }); - }); - }; -} - export function doPlayUri(uri) { return dispatch => { dispatch(doSetPlayingUri(uri)); @@ -405,24 +382,6 @@ export function doCreateChannel(name: string, amount: number) { }; } -export function doPublish(params) { - return dispatch => - new Promise((resolve, reject) => { - const success = claim => { - resolve(claim); - - if (claim === true) dispatch(doFetchClaimListMine()); - else - setTimeout(() => dispatch(doFetchClaimListMine()), 20000, { - once: true, - }); - }; - const failure = err => reject(err); - - Lbry.publishDeprecated(params, null, success, failure); - }); -} - export function savePosition(claimId: string, outpoint: string, position: number) { return dispatch => { dispatch({