don't persist by default for FileList

This commit is contained in:
Sean Yesmunt 2019-06-11 14:38:08 -04:00
parent 510307de01
commit 6e59e5b1b3
3 changed files with 8 additions and 12 deletions

View file

@ -24,7 +24,7 @@ type Props = {
export default function FileList(props: Props) {
const { uris, header, headerAltControls, injectedItem, loading, persistedStorageKey, noHeader, slim, empty } = props;
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey || 'file-list-global-sort', SORT_NEW);
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
const sortedUris = uris && currentSort === SORT_OLD ? uris.reverse() : uris;
const hasUris = uris && !!uris.length;

View file

@ -1,10 +1,10 @@
import { connect } from 'react-redux';
import { selectIsFetchingClaimListMine, selectMyClaimsWithoutChannels } from 'lbry-redux';
import { selectIsFetchingClaimListMine, selectMyClaimUrisWithoutChannels } from 'lbry-redux';
import { doCheckPendingPublishes } from 'redux/actions/publish';
import FileListPublished from './view';
const select = state => ({
claims: selectMyClaimsWithoutChannels(state),
uris: selectMyClaimUrisWithoutChannels(state),
fetching: selectIsFetchingClaimListMine(state),
});

View file

@ -5,27 +5,23 @@ import FileList from 'component/fileList';
import Page from 'component/page';
type Props = {
claims: Array<StreamClaim>,
uris: Array<string>,
checkPendingPublishes: () => void,
fetching: boolean,
};
function FileListPublished(props: Props) {
const { checkPendingPublishes, fetching, claims } = props;
const { checkPendingPublishes, fetching, uris } = props;
useEffect(() => {
checkPendingPublishes();
}, [checkPendingPublishes]);
return (
<Page notContained loading={fetching}>
{claims && claims.length ? (
<Page notContained>
{uris && uris.length ? (
<div className="card">
<FileList
persistedStorageKey="file-list-published"
// TODO: adjust selector to only return uris
uris={claims.map(info => `lbry://${info.name}#${info.claim_id}`)}
/>
<FileList loading={fetching} persistedStorageKey="file-list-published" uris={uris} />
</div>
) : (
<div className="main--empty">