lbry-desktop/web/component/ads/index.js
infinite-persistence 745e40a83e
Move blocker flag to redux
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.
2022-03-16 16:48:26 +08:00

19 lines
676 B
JavaScript

import { connect } from 'react-redux';
import { doSetAdBlockerFound } from 'redux/actions/app';
import { selectTheme } from 'redux/selectors/settings';
import { makeSelectClaimForUri, selectClaimIsNsfwForUri } from 'redux/selectors/claims';
import { selectOdyseeMembershipIsPremiumPlus } from 'redux/selectors/user';
import Ads from './view';
const select = (state, props) => ({
theme: selectTheme(state),
claim: makeSelectClaimForUri(props.uri)(state),
isMature: selectClaimIsNsfwForUri(state, props.uri),
userHasPremiumPlus: selectOdyseeMembershipIsPremiumPlus(state),
});
const perform = {
doSetAdBlockerFound,
};
export default connect(select, perform)(Ads);