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;
|
return fileInfo && fileInfo.download_path;
|
||||||
});
|
});
|
||||||
|
|
||||||
const makeSelectFilePartlyDownloaded = uri => reselect.createSelector(selectFileInfosByOutpoint, makeSelectClaimForUri(uri), (downloadsByOutpoint, claim) => {
|
const makeSelectFilePartlyDownloaded = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), fileInfo => {
|
||||||
if (!claim) {
|
if (!fileInfo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { txid, nout } = claim;
|
return fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0;
|
||||||
const outpoint = `${txid}:${nout}`;
|
|
||||||
const isDownloaded = downloadsByOutpoint[outpoint];
|
|
||||||
return isDownloaded;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const makeSelectFileNameForUri = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), fileInfo => {
|
const makeSelectFileNameForUri = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), fileInfo => {
|
||||||
|
|
|
@ -285,17 +285,13 @@ export const makeSelectDownloadPathForUri = uri =>
|
||||||
|
|
||||||
export const makeSelectFilePartlyDownloaded = uri =>
|
export const makeSelectFilePartlyDownloaded = uri =>
|
||||||
createSelector(
|
createSelector(
|
||||||
selectFileInfosByOutpoint,
|
makeSelectFileInfoForUri(uri),
|
||||||
makeSelectClaimForUri(uri),
|
fileInfo => {
|
||||||
(downloadsByOutpoint, claim) => {
|
if (!fileInfo) {
|
||||||
if (!claim) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { txid, nout } = claim;
|
return fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0;
|
||||||
const outpoint = `${txid}:${nout}`;
|
|
||||||
const isDownloaded = downloadsByOutpoint[outpoint];
|
|
||||||
return isDownloaded;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue