actually check if something's been downloaded

This commit is contained in:
Sean Yesmunt 2019-08-14 13:51:30 -04:00
parent adbbd7e660
commit 1bd625f0c6
2 changed files with 7 additions and 14 deletions

9
dist/bundle.es.js vendored
View file

@ -2625,15 +2625,12 @@ const makeSelectDownloadPathForUri = uri => reselect.createSelector(makeSelectFi
return fileInfo && fileInfo.download_path;
});
const makeSelectFilePartlyDownloaded = uri => reselect.createSelector(selectFileInfosByOutpoint, makeSelectClaimForUri(uri), (downloadsByOutpoint, claim) => {
if (!claim) {
const makeSelectFilePartlyDownloaded = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), fileInfo => {
if (!fileInfo) {
return false;
}
const { txid, nout } = claim;
const outpoint = `${txid}:${nout}`;
const isDownloaded = downloadsByOutpoint[outpoint];
return isDownloaded;
return fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0;
});
const makeSelectFileNameForUri = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), fileInfo => {

View file

@ -285,17 +285,13 @@ export const makeSelectDownloadPathForUri = uri =>
export const makeSelectFilePartlyDownloaded = uri =>
createSelector(
selectFileInfosByOutpoint,
makeSelectClaimForUri(uri),
(downloadsByOutpoint, claim) => {
if (!claim) {
makeSelectFileInfoForUri(uri),
fileInfo => {
if (!fileInfo) {
return false;
}
const { txid, nout } = claim;
const outpoint = `${txid}:${nout}`;
const isDownloaded = downloadsByOutpoint[outpoint];
return isDownloaded;
return fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0;
}
);