lbry-desktop/ui/page/fileListPublished/index.js

32 lines
1,001 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import {
selectIsFetchingClaimListMine,
makeSelectMyStreamUrlsForPage,
selectMyStreamUrlsCount,
doClearPublish,
doFetchClaimListMine,
} from 'lbry-redux';
2019-07-12 22:59:45 -04:00
import { doCheckPendingPublishesApp } from 'redux/actions/publish';
import FileListPublished from './view';
2019-09-23 13:32:38 -04:00
import { withRouter } from 'react-router';
2019-09-23 13:32:38 -04:00
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
2019-09-25 17:17:23 -04:00
const page = Number(urlParams.get('page')) || 1;
2019-09-23 13:32:38 -04:00
return {
page,
2019-09-25 17:37:01 -04:00
urls: makeSelectMyStreamUrlsForPage(page)(state),
urlTotal: selectMyStreamUrlsCount(state),
2019-09-23 13:32:38 -04:00
fetching: selectIsFetchingClaimListMine(state),
};
};
2017-06-05 21:21:55 -07:00
const perform = dispatch => ({
2019-07-12 22:59:45 -04:00
checkPendingPublishes: () => dispatch(doCheckPendingPublishesApp()),
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
clearPublish: () => dispatch(doClearPublish()),
2017-06-05 21:21:55 -07:00
});
export default withRouter(connect(select, perform)(FileListPublished));