fix playlist resolving collectionurls (#7178)

* fix playlist resolving collectionurls

* Update CHANGELOG.md

Co-authored-by: Thomas Zarebczan <tzarebczan@users.noreply.github.com>
This commit is contained in:
Bradley Ray 2021-09-30 08:03:50 -05:00 committed by GitHub
parent 26f80b0ec5
commit 819bdea0c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix floating player stopping on markdown or image files ([#7073](https://github.com/lbryio/lbry-desktop/pull/7073))
- Fix list thumbnail upload ([#7074](https://github.com/lbryio/lbry-desktop/pull/7074))
- Stream Key is now hidden _community pr!_ ([#7127](https://github.com/lbryio/lbry-desktop/pull/7127))
- Fix playlist preview thumbnail ([#7178](https://github.com/lbryio/lbry-desktop/pull/7178)
- Fixed “Your Account” popup on mobile ([#7172](https://github.com/lbryio/lbry-desktop/pull/7172))
## [0.51.2] - [2021-08-20]

View file

@ -7,6 +7,7 @@ import {
makeSelectNameForCollectionId,
makeSelectPendingCollectionForId,
makeSelectCountForCollectionId,
doFetchItemsInCollection,
} from 'lbry-redux';
import CollectionPreviewOverlay from './view';
@ -27,4 +28,8 @@ const select = (state, props) => {
};
};
export default connect(select)(CollectionPreviewOverlay);
const perform = (dispatch) => ({
fetchCollectionItems: (claimId) => dispatch(doFetchItemsInCollection({ collectionId: claimId })), // if collection not resolved, resolve it
});
export default connect(select, perform)(CollectionPreviewOverlay);

View file

@ -12,10 +12,17 @@ type Props = {
pendingCollection?: Collection,
claim: ?Claim,
collectionItemUrls: Array<string>,
fetchCollectionItems: (string) => void,
};
function CollectionPreviewOverlay(props: Props) {
const { collectionItemUrls } = props;
const { collectionId, collectionItemUrls, fetchCollectionItems } = props;
React.useEffect(() => {
if (!collectionItemUrls) {
fetchCollectionItems(collectionId);
}
}, [collectionId, collectionItemUrls, fetchCollectionItems]);
if (collectionItemUrls && collectionItemUrls.length > 0) {
return (