uri to url
This commit is contained in:
parent
53402c4759
commit
f698680c15
4 changed files with 18 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectDownloadUrisForPage, selectDownloadUrisCount, selectIsFetchingFileList } from 'lbry-redux';
|
||||
import { makeSelectDownloadUrlsForPage, selectDownloadUrlsCount, selectIsFetchingFileList } from 'lbry-redux';
|
||||
import FileListDownloaded from './view';
|
||||
import { withRouter } from 'react-router';
|
||||
|
||||
|
@ -9,8 +9,8 @@ const select = (state, props) => {
|
|||
const page = Number(urlParams.get('page')) || 1;
|
||||
return {
|
||||
page,
|
||||
downloadedUris: makeSelectDownloadUrisForPage(page)(state),
|
||||
downloadedUrisCount: selectDownloadUrisCount(state),
|
||||
downloadedUrls: makeSelectDownloadUrlsForPage(page)(state),
|
||||
downloadedUrlsCount: selectDownloadUrlsCount(state),
|
||||
fetching: selectIsFetchingFileList(state),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,15 +7,15 @@ import { PAGE_SIZE } from 'constants/claim';
|
|||
|
||||
type Props = {
|
||||
fetching: boolean,
|
||||
downloadedUris: Array<string>,
|
||||
downloadedUrisCount: ?number,
|
||||
downloadedUrls: Array<string>,
|
||||
downloadedUrlsCount: ?number,
|
||||
history: { replace: string => void },
|
||||
page: number,
|
||||
};
|
||||
|
||||
function FileListDownloaded(props: Props) {
|
||||
const { fetching, downloadedUris, downloadedUrisCount } = props;
|
||||
const hasDownloads = !!downloadedUris.length;
|
||||
const { fetching, downloadedUrls, downloadedUrlsCount } = props;
|
||||
const hasDownloads = !!downloadedUrls.length;
|
||||
return (
|
||||
// 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
|
||||
|
@ -26,10 +26,10 @@ function FileListDownloaded(props: Props) {
|
|||
header={__('Your Library')}
|
||||
defaultSort
|
||||
persistedStorageKey="claim-list-downloaded"
|
||||
uris={downloadedUris}
|
||||
uris={downloadedUrls}
|
||||
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 className="main--empty">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 FileListPublished from './view';
|
||||
import { withRouter } from 'react-router';
|
||||
|
@ -10,8 +10,8 @@ const select = (state, props) => {
|
|||
const page = Number(urlParams.get('page')) || 1;
|
||||
return {
|
||||
page,
|
||||
uris: makeSelectMyStreamUrisForPage(page)(state),
|
||||
uriTotal: selectMyStreamUrisCount(state),
|
||||
urls: makeSelectMyStreamUrlsForPage(page)(state),
|
||||
urlTotal: selectMyStreamUrlsCount(state),
|
||||
fetching: selectIsFetchingClaimListMine(state),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -9,31 +9,31 @@ import { PAGE_SIZE } from 'constants/claim';
|
|||
type Props = {
|
||||
checkPendingPublishes: () => void,
|
||||
fetching: boolean,
|
||||
uris: Array<string>,
|
||||
uriTotal: ?number,
|
||||
urls: Array<string>,
|
||||
urlTotal: ?number,
|
||||
history: { replace: string => void },
|
||||
page: number,
|
||||
};
|
||||
|
||||
function FileListPublished(props: Props) {
|
||||
const { checkPendingPublishes, fetching, uris, uriTotal } = props;
|
||||
const { checkPendingPublishes, fetching, urls, urlTotal } = props;
|
||||
useEffect(() => {
|
||||
checkPendingPublishes();
|
||||
}, [checkPendingPublishes]);
|
||||
|
||||
return (
|
||||
<Page notContained>
|
||||
{uris && uris.length ? (
|
||||
{urls && urls.length ? (
|
||||
<div className="card">
|
||||
<ClaimList
|
||||
header={__('Your Publishes')}
|
||||
loading={fetching}
|
||||
persistedStorageKey="claim-list-published"
|
||||
uris={uris}
|
||||
uris={urls}
|
||||
defaultSort
|
||||
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 className="main--empty">
|
||||
|
|
Loading…
Add table
Reference in a new issue