uri to url

This commit is contained in:
jessop 2019-09-25 17:37:01 -04:00 committed by Sean Yesmunt
parent 53402c4759
commit f698680c15
4 changed files with 18 additions and 18 deletions

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { makeSelectDownloadUrisForPage, selectDownloadUrisCount, selectIsFetchingFileList } from 'lbry-redux'; import { makeSelectDownloadUrlsForPage, selectDownloadUrlsCount, selectIsFetchingFileList } from 'lbry-redux';
import FileListDownloaded from './view'; import FileListDownloaded from './view';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
@ -9,8 +9,8 @@ const select = (state, props) => {
const page = Number(urlParams.get('page')) || 1; const page = Number(urlParams.get('page')) || 1;
return { return {
page, page,
downloadedUris: makeSelectDownloadUrisForPage(page)(state), downloadedUrls: makeSelectDownloadUrlsForPage(page)(state),
downloadedUrisCount: selectDownloadUrisCount(state), downloadedUrlsCount: selectDownloadUrlsCount(state),
fetching: selectIsFetchingFileList(state), fetching: selectIsFetchingFileList(state),
}; };
}; };

View file

@ -7,15 +7,15 @@ import { PAGE_SIZE } from 'constants/claim';
type Props = { type Props = {
fetching: boolean, fetching: boolean,
downloadedUris: Array<string>, downloadedUrls: Array<string>,
downloadedUrisCount: ?number, downloadedUrlsCount: ?number,
history: { replace: string => void }, history: { replace: string => void },
page: number, page: number,
}; };
function FileListDownloaded(props: Props) { function FileListDownloaded(props: Props) {
const { fetching, downloadedUris, downloadedUrisCount } = props; const { fetching, downloadedUrls, downloadedUrlsCount } = props;
const hasDownloads = !!downloadedUris.length; const hasDownloads = !!downloadedUrls.length;
return ( return (
// Removed the <Page> wapper to try combining this page with UserHistory // Removed the <Page> wapper to try combining this page with UserHistory
// This should eventually move into /components if we want to keep it this way // This should eventually move into /components if we want to keep it this way
@ -26,10 +26,10 @@ function FileListDownloaded(props: Props) {
header={__('Your Library')} header={__('Your Library')}
defaultSort defaultSort
persistedStorageKey="claim-list-downloaded" persistedStorageKey="claim-list-downloaded"
uris={downloadedUris} uris={downloadedUrls}
loading={fetching} loading={fetching}
/> />
<Paginate totalPages={Math.ceil(Number(downloadedUrisCount) / Number(PAGE_SIZE))} loading={fetching} /> <Paginate totalPages={Math.ceil(Number(downloadedUrlsCount) / Number(PAGE_SIZE))} loading={fetching} />
</div> </div>
) : ( ) : (
<div className="main--empty"> <div className="main--empty">

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { selectIsFetchingClaimListMine, makeSelectMyStreamUrisForPage, selectMyStreamUrisCount } from 'lbry-redux'; import { selectIsFetchingClaimListMine, makeSelectMyStreamUrlsForPage, selectMyStreamUrlsCount } from 'lbry-redux';
import { doCheckPendingPublishesApp } from 'redux/actions/publish'; import { doCheckPendingPublishesApp } from 'redux/actions/publish';
import FileListPublished from './view'; import FileListPublished from './view';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
@ -10,8 +10,8 @@ const select = (state, props) => {
const page = Number(urlParams.get('page')) || 1; const page = Number(urlParams.get('page')) || 1;
return { return {
page, page,
uris: makeSelectMyStreamUrisForPage(page)(state), urls: makeSelectMyStreamUrlsForPage(page)(state),
uriTotal: selectMyStreamUrisCount(state), urlTotal: selectMyStreamUrlsCount(state),
fetching: selectIsFetchingClaimListMine(state), fetching: selectIsFetchingClaimListMine(state),
}; };
}; };

View file

@ -9,31 +9,31 @@ import { PAGE_SIZE } from 'constants/claim';
type Props = { type Props = {
checkPendingPublishes: () => void, checkPendingPublishes: () => void,
fetching: boolean, fetching: boolean,
uris: Array<string>, urls: Array<string>,
uriTotal: ?number, urlTotal: ?number,
history: { replace: string => void }, history: { replace: string => void },
page: number, page: number,
}; };
function FileListPublished(props: Props) { function FileListPublished(props: Props) {
const { checkPendingPublishes, fetching, uris, uriTotal } = props; const { checkPendingPublishes, fetching, urls, urlTotal } = props;
useEffect(() => { useEffect(() => {
checkPendingPublishes(); checkPendingPublishes();
}, [checkPendingPublishes]); }, [checkPendingPublishes]);
return ( return (
<Page notContained> <Page notContained>
{uris && uris.length ? ( {urls && urls.length ? (
<div className="card"> <div className="card">
<ClaimList <ClaimList
header={__('Your Publishes')} header={__('Your Publishes')}
loading={fetching} loading={fetching}
persistedStorageKey="claim-list-published" persistedStorageKey="claim-list-published"
uris={uris} uris={urls}
defaultSort defaultSort
headerAltControls={<Button button="link" label={__('New Publish')} navigate="/$/publish" />} headerAltControls={<Button button="link" label={__('New Publish')} navigate="/$/publish" />}
/> />
<Paginate totalPages={Math.ceil(Number(uriTotal) / Number(PAGE_SIZE))} loading={fetching} /> <Paginate totalPages={Math.ceil(Number(urlTotal) / Number(PAGE_SIZE))} loading={fetching} />
</div> </div>
) : ( ) : (
<div className="main--empty"> <div className="main--empty">