lbry-desktop/ui/component/recommendedContent/index.js
infinite-persistence d279d70770 Fix autoplay in floating mode
Closes 5000: AutoPlay in Floating Player only works one time

Factor out the code that queries the recommendation. It needs to be called in two places:
(1) `RecommendedContent` - need to cover the case of floating player + visit another video page.
(2) When video is floating and autoplayed the next video.
2021-04-02 14:35:18 -04:00

22 lines
964 B
JavaScript

import { connect } from 'react-redux';
import { makeSelectClaimIsNsfw } from 'lbry-redux';
import { doFetchRecommendedContent } from 'redux/actions/search';
import { makeSelectRecommendedContentForUri, selectIsSearching } from 'redux/selectors/search';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
import RecommendedVideos from './view';
const select = (state, props) => ({
mature: makeSelectClaimIsNsfw(props.uri)(state),
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
nextRecommendedUri: makeSelectNextUnplayedRecommended(props.uri)(state),
isSearching: selectIsSearching(state),
isAuthenticated: selectUserVerifiedEmail(state),
});
const perform = (dispatch) => ({
doFetchRecommendedContent: (uri, mature) => dispatch(doFetchRecommendedContent(uri, mature)),
});
export default connect(select, perform)(RecommendedVideos);