lbry-desktop/ui/page/fileListPublished/index.js
2019-11-11 13:27:29 -05:00

34 lines
949 B
JavaScript

import { connect } from 'react-redux';
import {
selectIsFetchingClaimListMine,
makeSelectMyStreamUrlsForPage,
selectMyStreamUrlsCount,
doFetchClaimListMine,
} from 'lbry-redux';
import { doCheckPendingPublishesApp } from 'redux/actions/publish';
import FileListPublished from './view';
import { withRouter } from 'react-router';
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
const page = Number(urlParams.get('page')) || 1;
return {
page,
urls: makeSelectMyStreamUrlsForPage(page)(state),
urlTotal: selectMyStreamUrlsCount(state),
fetching: selectIsFetchingClaimListMine(state),
};
};
const perform = dispatch => ({
checkPendingPublishes: () => dispatch(doCheckPendingPublishesApp()),
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
});
export default withRouter(
connect(
select,
perform
)(FileListPublished)
);