lbry-desktop/ui/component/livestreamComments/index.js

21 lines
674 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { selectIsFetchingComments } from 'redux/selectors/comments';
import { selectIsUriResolving } from 'redux/selectors/claims';
import { VIEW_MODES } from 'ui/component/livestreamChatLayout/view';
import LivestreamComments from './view';
2021-10-11 08:02:17 +02:00
const select = (state, props) => {
const { comments, viewMode } = props;
return {
fetchingComments: selectIsFetchingComments(state),
resolvingSuperchats: Boolean(
viewMode === VIEW_MODES.SUPERCHAT &&
comments &&
comments.some(({ channel_url }) => selectIsUriResolving(state, channel_url))
),
};
};
export default connect(select)(LivestreamComments);