fix: loading selector after getting rid of urisLoading - missed this

This commit is contained in:
Sean Yesmunt 2019-08-14 13:08:38 -04:00
parent b3692b532f
commit adbbd7e660
2 changed files with 23 additions and 4 deletions

13
dist/bundle.es.js vendored
View file

@ -2452,9 +2452,18 @@ const makeSelectDownloadingForUri = uri => reselect.createSelector(selectDownloa
return byOutpoint[fileInfo.outpoint];
});
const selectUrisLoading = reselect.createSelector(selectState$3, state => state.urisLoading || {});
const selectUrisLoading = reselect.createSelector(selectState$3, state => state.fetching || {});
const makeSelectLoadingForUri = uri => reselect.createSelector(selectUrisLoading, byUri => byUri && byUri[uri]);
const makeSelectLoadingForUri = uri => reselect.createSelector(selectUrisLoading, makeSelectClaimForUri(uri), (fetchingByOutpoint, claim) => {
if (!claim) {
return false;
}
const { txid, nout } = claim;
const outpoint = `${txid}:${nout}`;
const isFetching = fetchingByOutpoint[outpoint];
return isFetching;
});
const selectFileInfosDownloaded = reselect.createSelector(selectFileInfosByOutpoint, selectMyClaims, (byOutpoint, myClaims) => Object.values(byOutpoint).filter(fileInfo => {
const myClaimIds = myClaims.map(claim => claim.claim_id);

View file

@ -56,13 +56,23 @@ export const makeSelectDownloadingForUri = uri =>
export const selectUrisLoading = createSelector(
selectState,
state => state.urisLoading || {}
state => state.fetching || {}
);
export const makeSelectLoadingForUri = uri =>
createSelector(
selectUrisLoading,
byUri => byUri && byUri[uri]
makeSelectClaimForUri(uri),
(fetchingByOutpoint, claim) => {
if (!claim) {
return false;
}
const { txid, nout } = claim;
const outpoint = `${txid}:${nout}`;
const isFetching = fetchingByOutpoint[outpoint];
return isFetching;
}
);
export const selectFileInfosDownloaded = createSelector(