lbry-desktop/ui/page/livestream/index.js

39 lines
1.4 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
2022-03-15 17:18:08 +01:00
import { doSetPrimaryUri } from 'redux/actions/content';
import { doUserSetReferrer } from 'redux/actions/user';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
2022-03-16 12:35:58 +01:00
import { doCommentSocketConnect } from 'redux/actions/websocket';
import { getChannelIdFromClaim } from 'util/claim';
import {
selectActiveLivestreamForChannel,
selectActiveLivestreamInitialized,
selectCommentSocketConnected,
} from 'redux/selectors/livestream';
2022-03-16 12:35:58 +01:00
import { doFetchChannelLiveStatus } from 'redux/actions/livestream';
import LivestreamPage from './view';
const select = (state, props) => {
const { uri } = props;
const channelClaimId = getChannelIdFromClaim(selectClaimForUri(state, uri));
return {
isAuthenticated: selectUserVerifiedEmail(state),
channelClaimId,
chatDisabled: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_COMMENTS_TAG)(state),
activeLivestreamForChannel: selectActiveLivestreamForChannel(state, channelClaimId),
activeLivestreamInitialized: selectActiveLivestreamInitialized(state),
socketConnected: selectCommentSocketConnected(state),
};
};
const perform = {
2022-03-15 17:18:08 +01:00
doSetPrimaryUri,
doUserSetReferrer,
doCommentSocketConnect,
doFetchChannelLiveStatus,
};
export default connect(select, perform)(LivestreamPage);