Remove dead code per code review.

This commit is contained in:
Jeffrey Fisher 2020-04-21 15:09:02 -07:00 committed by Sean Yesmunt
parent 7adf165f08
commit 3535703017
2 changed files with 2 additions and 60 deletions

View file

@ -1,5 +1,4 @@
import { connect } from 'react-redux';
import { doFetchClaimsByChannel } from 'redux/actions/content';
import { PAGE_SIZE } from 'constants/claim';
import {
makeSelectClaimsInChannelForPage,
@ -28,8 +27,4 @@ const select = (state, props) => {
};
};
const perform = dispatch => ({
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
});
export default withRouter(connect(select, perform)(ChannelPage));
export default withRouter(connect(select)(ChannelPage));

View file

@ -1,18 +1,16 @@
// @flow
import * as SETTINGS from 'constants/settings';
import * as NOTIFICATION_TYPES from 'constants/subscriptions';
import { PAGE_SIZE } from 'constants/claim';
import * as MODALS from 'constants/modal_types';
// @if TARGET='app'
import { ipcRenderer } from 'electron';
// @endif
import { doOpenModal } from 'redux/actions/app';
import { push } from 'connected-react-router';
import { setSubscriptionLatest, doUpdateUnreadSubscriptions } from 'redux/actions/subscriptions';
import { doUpdateUnreadSubscriptions } from 'redux/actions/subscriptions';
import { makeSelectUnreadByChannel } from 'redux/selectors/subscriptions';
import {
ACTIONS,
MATURE_TAGS,
Lbry,
Lbryapi,
makeSelectFileInfoForUri,
@ -137,57 +135,6 @@ export function doSetPlayingUri(uri: ?string) {
};
}
export function doFetchClaimsByChannel(uri: string, page: number = 1, pageSize: number = PAGE_SIZE) {
return (dispatch: Dispatch, getState: GetState) => {
const state = getState();
const showMature = makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state);
const params = {};
params.channel = uri;
params.page = page;
params.page_size = pageSize;
params.valid_channel_signature = true;
params.order_by = ['release_time'];
if (!showMature) {
params.not_tags = MATURE_TAGS;
}
dispatch({
type: ACTIONS.FETCH_CHANNEL_CLAIMS_STARTED,
data: { uri, page },
});
Lbry.claim_search(params).then(result => {
const { items: claims, page: returnedPage, total_items: claimsInChannel, total_pages: pageTotal } = result;
if (claims && claims.length) {
if (page === 1) {
const latest = claims[0];
dispatch(
setSubscriptionLatest(
{
channelName: latest.signing_channel.name,
uri: latest.signing_channel.permanent_url,
},
latest.permanent_url
)
);
}
}
dispatch({
type: ACTIONS.FETCH_CHANNEL_CLAIMS_COMPLETED,
data: {
uri,
claimsInChannel,
claims: claims || [],
page: returnedPage || undefined,
totalPages: pageTotal,
},
});
});
};
}
export function doPurchaseUriWrapper(uri: string, cost: number, saveFile: boolean, cb: ?() => void) {
return (dispatch: Dispatch, getState: () => any) => {
function onSuccess(fileInfo) {