lbry-desktop/src/ui/page/fileListDownloaded/index.js

24 lines
691 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2019-09-23 19:32:38 +02:00
import { makeSelectDownloadUrisForPage, selectDownloadUrisCount, selectIsFetchingFileList } from 'lbry-redux';
import FileListDownloaded from './view';
2019-09-23 19:32:38 +02:00
import { withRouter } from 'react-router';
2019-09-23 19:32:38 +02:00
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
const page = Number(urlParams.get('page')) || 0;
return {
page,
downloadedUris: makeSelectDownloadUrisForPage(page)(state),
downloadedUrisCount: selectDownloadUrisCount(state),
fetching: selectIsFetchingFileList(state),
};
};
2019-09-23 19:32:38 +02:00
export default withRouter(
connect(
select,
null
)(FileListDownloaded)
);