Take 'incognito' into account when reposting

## Issue
Fixes 5661: can't choose anonymous from channel on repost page
This commit is contained in:
infinite-persistence 2021-03-15 11:39:26 +08:00 committed by Sean Yesmunt
parent d91530b0c8
commit 9fadf3850f
2 changed files with 5 additions and 2 deletions

View file

@ -17,7 +17,7 @@ import {
selectFetchingMyChannels, selectFetchingMyChannels,
} from 'lbry-redux'; } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { selectActiveChannelClaim } from 'redux/selectors/app'; import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
import RepostCreate from './view'; import RepostCreate from './view';
const select = (state, props) => ({ const select = (state, props) => ({
@ -37,6 +37,7 @@ const select = (state, props) => ({
isResolvingEnteredRepost: props.repostUri && makeSelectIsUriResolving(`lbry://${props.repostUri}`)(state), isResolvingEnteredRepost: props.repostUri && makeSelectIsUriResolving(`lbry://${props.repostUri}`)(state),
activeChannelClaim: selectActiveChannelClaim(state), activeChannelClaim: selectActiveChannelClaim(state),
fetchingMyChannels: selectFetchingMyChannels(state), fetchingMyChannels: selectFetchingMyChannels(state),
incognito: selectIncognito(state),
}); });
export default connect(select, { export default connect(select, {

View file

@ -42,6 +42,7 @@ type Props = {
isResolvingEnteredRepost: boolean, isResolvingEnteredRepost: boolean,
activeChannelClaim: ?ChannelClaim, activeChannelClaim: ?ChannelClaim,
fetchingMyChannels: boolean, fetchingMyChannels: boolean,
incognito: boolean,
}; };
function RepostCreate(props: Props) { function RepostCreate(props: Props) {
@ -67,6 +68,7 @@ function RepostCreate(props: Props) {
isResolvingEnteredRepost, isResolvingEnteredRepost,
activeChannelClaim, activeChannelClaim,
fetchingMyChannels, fetchingMyChannels,
incognito,
} = props; } = props;
const defaultName = name || (claim && claim.name) || ''; const defaultName = name || (claim && claim.name) || '';
@ -281,7 +283,7 @@ function RepostCreate(props: Props) {
doRepost({ doRepost({
name: enteredRepostName, name: enteredRepostName,
bid: creditsToString(repostBid), bid: creditsToString(repostBid),
channel_id: activeChannelClaim ? activeChannelClaim.claim_id : undefined, channel_id: activeChannelClaim && !incognito ? activeChannelClaim.claim_id : undefined,
claim_id: repostClaimId, claim_id: repostClaimId,
}).then((repostClaim: StreamClaim) => { }).then((repostClaim: StreamClaim) => {
doCheckPendingClaims(); doCheckPendingClaims();