745e40a83e
Was trying to save 1 state by assuming the homepage will be in a busy state and the ad-detection code will finish first. But this is not true for those with a small Following count.
29 lines
1.3 KiB
JavaScript
29 lines
1.3 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import * as SETTINGS from 'constants/settings';
|
|
import { doFetchActiveLivestreams } from 'redux/actions/livestream';
|
|
import { selectAdBlockerFound } from 'redux/selectors/app';
|
|
import { selectActiveLivestreams, selectFetchingActiveLivestreams } from 'redux/selectors/livestream';
|
|
import { selectFollowedTags } from 'redux/selectors/tags';
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
|
import { selectShowMatureContent, selectHomepageData, selectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import DiscoverPage from './view';
|
|
|
|
const select = (state) => ({
|
|
followedTags: selectFollowedTags(state),
|
|
subscribedChannels: selectSubscriptions(state),
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
showNsfw: selectShowMatureContent(state),
|
|
homepageData: selectHomepageData(state),
|
|
activeLivestreams: selectActiveLivestreams(state),
|
|
fetchingActiveLivestreams: selectFetchingActiveLivestreams(state),
|
|
hideScheduledLivestreams: selectClientSetting(state, SETTINGS.HIDE_SCHEDULED_LIVESTREAMS),
|
|
adBlockerFound: selectAdBlockerFound(state),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
doFetchActiveLivestreams: () => dispatch(doFetchActiveLivestreams()),
|
|
});
|
|
|
|
export default connect(select, perform)(DiscoverPage);
|