diff --git a/dist/bundle.es.js b/dist/bundle.es.js index aeb5956..baa40ce 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -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 => { diff --git a/src/redux/selectors/file_info.js b/src/redux/selectors/file_info.js index 25af571..c36bd76 100644 --- a/src/redux/selectors/file_info.js +++ b/src/redux/selectors/file_info.js @@ -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; } );