2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2019-09-23 19:32:38 +02:00
|
|
|
import { makeSelectDownloadUrisForPage, selectDownloadUrisCount, selectIsFetchingFileList } from 'lbry-redux';
|
2017-12-21 22:08:54 +01:00
|
|
|
import FileListDownloaded from './view';
|
2019-09-23 19:32:38 +02:00
|
|
|
import { withRouter } from 'react-router';
|
2017-04-23 18:10:45 +02:00
|
|
|
|
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),
|
|
|
|
};
|
|
|
|
};
|
2017-04-23 18:10:45 +02:00
|
|
|
|
2019-09-23 19:32:38 +02:00
|
|
|
export default withRouter(
|
|
|
|
connect(
|
|
|
|
select,
|
|
|
|
null
|
|
|
|
)(FileListDownloaded)
|
|
|
|
);
|