2021-03-10 19:34:21 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-01-14 21:24:16 +01:00
|
|
|
import { selectIsFetchingComments } from 'redux/selectors/comments';
|
2022-02-14 20:28:25 +01:00
|
|
|
import { selectIsUriResolving } from 'redux/selectors/claims';
|
|
|
|
import { VIEW_MODES } from 'ui/component/livestreamChatLayout/view';
|
2021-11-17 08:45:58 +01:00
|
|
|
import LivestreamComments from './view';
|
2021-10-11 08:02:17 +02:00
|
|
|
|
2022-02-14 20:28:25 +01: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))
|
|
|
|
),
|
|
|
|
};
|
|
|
|
};
|
2021-03-10 19:34:21 +01:00
|
|
|
|
2022-01-14 21:24:16 +01:00
|
|
|
export default connect(select)(LivestreamComments);
|