lbry-desktop/ui/component/comment/index.js
infinite-persistence e361289c06 Don't close main player when editing comments
https://discord.com/channels/362322208485277697/363087331475062785/815132676293918730

- Renamed `closeInlinePlayer` to `clearPlayingUri` to reflect it's actual function.
- Add additional check to see if the current video is actually inline before closing it.

Wanted to refactor out an actual `closeInlinePlayer`, but let's wait until there are more usages.
2021-03-08 11:21:57 -05:00

30 lines
1.4 KiB
JavaScript

import { connect } from 'react-redux';
import { makeSelectThumbnailForUri, selectMyChannelClaims } from 'lbry-redux';
import { doCommentUpdate } from 'redux/actions/comments';
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { doToast } from 'redux/actions/notifications';
import { doSetPlayingUri } from 'redux/actions/content';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import { selectPlayingUri } from 'redux/selectors/content';
import Comment from './view';
const select = (state, props) => ({
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
activeChannelClaim: selectActiveChannelClaim(state),
myChannels: selectMyChannelClaims(state),
playingUri: selectPlayingUri(state),
});
const perform = (dispatch) => ({
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
updateComment: (commentId, comment) => dispatch(doCommentUpdate(commentId, comment)),
doToast: (options) => dispatch(doToast(options)),
});
export default connect(select, perform)(Comment);