2021-03-02 03:07:10 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-12-09 10:23:23 +01:00
|
|
|
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
|
2021-03-15 15:32:51 +01:00
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
|
|
import { doUserSetReferrer } from 'redux/actions/user';
|
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-06-03 17:55:16 +02:00
|
|
|
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
2021-12-16 22:59:13 +01:00
|
|
|
import { doCommentSocketConnect, doCommentSocketDisconnect } from 'redux/actions/websocket';
|
2021-12-09 10:23:23 +01:00
|
|
|
import { getChannelIdFromClaim } from 'util/claim';
|
2021-12-16 22:59:13 +01:00
|
|
|
import { selectCurrentChannelStatus } from 'redux/selectors/livestream';
|
|
|
|
import { doFetchActiveLivestream } from 'redux/actions/livestream';
|
2021-03-15 15:32:51 +01:00
|
|
|
import LivestreamPage from './view';
|
2021-03-02 03:07:10 +01:00
|
|
|
|
2021-03-22 10:42:02 +01:00
|
|
|
const select = (state, props) => ({
|
2021-03-15 15:32:51 +01:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2021-12-09 10:23:23 +01:00
|
|
|
channelClaimId: getChannelIdFromClaim(selectClaimForUri(state, props.uri)),
|
2021-06-03 17:55:16 +02:00
|
|
|
chatDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
|
2021-12-16 22:59:13 +01:00
|
|
|
currentChannelStatus: selectCurrentChannelStatus(state),
|
2021-03-02 03:07:10 +01:00
|
|
|
});
|
|
|
|
|
2021-12-16 22:59:13 +01:00
|
|
|
const perform = {
|
2021-03-15 15:32:51 +01:00
|
|
|
doSetPlayingUri,
|
|
|
|
doUserSetReferrer,
|
2021-12-16 22:59:13 +01:00
|
|
|
doCommentSocketConnect,
|
|
|
|
doCommentSocketDisconnect,
|
|
|
|
doFetchActiveLivestream,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, perform)(LivestreamPage);
|