diff --git a/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/index.js b/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/index.js index 1f77c9a50e..c160ff6404 100644 --- a/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/index.js +++ b/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/index.js @@ -1,5 +1,6 @@ import { connect } from 'react-redux'; import { doClaimSearch, doResolveClaimId, doResolveUris } from 'redux/actions/claims'; +import { doFetchThumbnailClaimsForCollectionIds } from 'redux/actions/collections'; import { selectActiveLivestreamForChannel } from 'redux/selectors/livestream'; import { createNormalizedClaimSearchKey } from 'util/claim'; import { @@ -86,6 +87,7 @@ const perform = { doClaimSearch, doResolveClaimId, doResolveUris, + doFetchThumbnailClaimsForCollectionIds, }; export default connect(select, perform)(HomeTabSection); diff --git a/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/view.jsx b/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/view.jsx index 84d8a8c02c..b509d5d6d9 100644 --- a/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/view.jsx +++ b/ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/view.jsx @@ -37,9 +37,10 @@ type Props = { activeLivestreamUri: ?ClaimUri, hasPremiumPlus: boolean, // --- perform --- - doClaimSearch: (ClaimSearchOptions, ?DoClaimSearchSettings) => void, + doClaimSearch: (ClaimSearchOptions, ?DoClaimSearchSettings) => Promise, doResolveClaimId: (claimId: string) => void, doResolveUris: (Array) => Promise, + doFetchThumbnailClaimsForCollectionIds: (params: { collectionIds: Array }) => void, }; function HomeTabSection(props: Props) { @@ -67,6 +68,7 @@ function HomeTabSection(props: Props) { doClaimSearch, doResolveClaimId, doResolveUris, + doFetchThumbnailClaimsForCollectionIds, } = props; const timedOut = claimSearchResults === null; @@ -92,7 +94,14 @@ function HomeTabSection(props: Props) { if (shouldPerformSearch) { const searchOptions = JSON.parse(optionsStringified); const searchSettings = { fetch: { viewCount: true } }; - doClaimSearch(searchOptions, searchSettings); + doClaimSearch(searchOptions, searchSettings).then((res) => { + if (section.type === 'playlists' && res) { + const streams = Object.values(res); + // $FlowIgnore flow bug + const claimIds = streams.map((s) => s?.stream?.claim_id); + doFetchThumbnailClaimsForCollectionIds({ collectionIds: claimIds }); + } + }); } // eslint-disable-next-line react-hooks/exhaustive-deps -- DOESN'T FEEL RIGHT WITHOUT optionsStringified }, [doClaimSearch, shouldPerformSearch]);