lbry-desktop/ui/modal/modalBlockChannel/index.js
infinite-persistence af4ff29b23
Fix: Can't unblock if delegator deleted their channel
## Issue
7003 Can't unblock if delegator deleted their channel

## Changes
- Changed the function parameter from 'creatorId' to 'creatorUri'
    - It got short-circuited because we don't resolve deleted channels. But the client already have the full creator URI (containing the needed 'name' and 'id'), so there is no need to actually look at the resolved list -- just pass the uri like all the other functions.
2021-09-11 21:04:21 +08:00

23 lines
1 KiB
JavaScript

import { connect } from 'react-redux';
import { makeSelectClaimForUri } from 'lbry-redux';
import { doHideModal } from 'redux/actions/app';
import { doCommentModBlock, doCommentModBlockAsAdmin, doCommentModBlockAsModerator } from 'redux/actions/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import { selectModerationDelegatorsById } from 'redux/selectors/comments';
import ModalBlockChannel from './view';
const select = (state, props) => ({
activeChannelClaim: selectActiveChannelClaim(state),
contentClaim: makeSelectClaimForUri(props.contentUri)(state),
moderationDelegatorsById: selectModerationDelegatorsById(state),
});
const perform = (dispatch) => ({
closeModal: () => dispatch(doHideModal()),
commentModBlock: (a, b) => dispatch(doCommentModBlock(a, b)),
commentModBlockAsAdmin: (a, b, c) => dispatch(doCommentModBlockAsAdmin(a, b, c)),
commentModBlockAsModerator: (a, b, c, d) => dispatch(doCommentModBlockAsModerator(a, b, c, d)),
});
export default connect(select, perform)(ModalBlockChannel);