diff --git a/CHANGELOG.md b/CHANGELOG.md index d8f65e2ee..0dd35a53c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Web UI version numbers should always match the corresponding version of LBRY App * Fixed bug with download notice when switching window focus * Fixed newly published files appearing twice * Fixed unconfirmed published files missing channel name + * Fixed old files from updated published claims appearing in downloaded list ### Deprecated * diff --git a/ui/js/component/fileList/view.jsx b/ui/js/component/fileList/view.jsx index edd64b993..f910e9500 100644 --- a/ui/js/component/fileList/view.jsx +++ b/ui/js/component/fileList/view.jsx @@ -81,7 +81,7 @@ class FileList extends React.PureComponent { content.push( ({ fileInfos: selectFileInfosDownloaded(state), isFetching: selectIsFetchingFileListDownloadedOrPublished(state), + claims: selectMyClaimsWithoutChannels(state), + isFetchingClaims: selectIsFetchingClaimListMine(state), }); const perform = dispatch => ({ @@ -19,6 +26,7 @@ const perform = dispatch => ({ fetchFileInfosDownloaded: () => dispatch(doFetchFileInfosAndPublishedClaims()), cancelResolvingUris: () => dispatch(doCancelAllResolvingUris()), + fetchClaims: () => dispatch(doFetchClaimListMine()), }); export default connect(select, perform)(FileListDownloaded); diff --git a/ui/js/page/fileListDownloaded/view.jsx b/ui/js/page/fileListDownloaded/view.jsx index c1501ec78..8eb18e9d5 100644 --- a/ui/js/page/fileListDownloaded/view.jsx +++ b/ui/js/page/fileListDownloaded/view.jsx @@ -12,6 +12,7 @@ import SubHeader from "component/subHeader"; class FileListDownloaded extends React.PureComponent { componentWillMount() { + if (!this.props.isFetchingClaims) this.props.fetchClaims(); if (!this.props.isFetching) this.props.fetchFileInfosDownloaded(); } diff --git a/ui/js/selectors/file_info.js b/ui/js/selectors/file_info.js index 7b8a10769..ef469ab02 100644 --- a/ui/js/selectors/file_info.js +++ b/ui/js/selectors/file_info.js @@ -3,6 +3,7 @@ import { createSelector } from "reselect"; import { selectClaimsByUri, selectIsFetchingClaimListMine, + selectMyClaims, selectMyClaimsOutpoints, } from "selectors/claims"; @@ -76,19 +77,17 @@ export const selectFileInfosPendingPublish = createSelector( export const selectFileInfosDownloaded = createSelector( selectFileInfosByOutpoint, - selectMyClaimsOutpoints, - (byOutpoint, myClaimOutpoints) => { - const fileInfoList = []; - Object.values(byOutpoint).forEach(fileInfo => { - if ( + selectMyClaims, + (byOutpoint, myClaims) => { + return Object.values(byOutpoint).filter(fileInfo => { + const myClaimIds = myClaims.map(claim => claim.claim_id); + + return ( fileInfo && - myClaimOutpoints.indexOf(fileInfo.outpoint) === -1 && + myClaimIds.indexOf(fileInfo.claim_id) === -1 && (fileInfo.completed || fileInfo.written_bytes) - ) { - fileInfoList.push(fileInfo); - } + ); }); - return fileInfoList; } );