actually check if something's been downloaded
This commit is contained in:
parent
adbbd7e660
commit
1bd625f0c6
2 changed files with 7 additions and 14 deletions
9
dist/bundle.es.js
vendored
9
dist/bundle.es.js
vendored
|
@ -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 => {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue