From 9fadf3850f52d3d9bec13350d3379865d4f7d9c1 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 15 Mar 2021 11:39:26 +0800 Subject: [PATCH] Take 'incognito' into account when reposting ## Issue Fixes 5661: can't choose anonymous from channel on repost page --- ui/component/repostCreate/index.js | 3 ++- ui/component/repostCreate/view.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/component/repostCreate/index.js b/ui/component/repostCreate/index.js index 4b142e8b9..07b5c5426 100644 --- a/ui/component/repostCreate/index.js +++ b/ui/component/repostCreate/index.js @@ -17,7 +17,7 @@ import { selectFetchingMyChannels, } from 'lbry-redux'; import { doToast } from 'redux/actions/notifications'; -import { selectActiveChannelClaim } from 'redux/selectors/app'; +import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app'; import RepostCreate from './view'; const select = (state, props) => ({ @@ -37,6 +37,7 @@ const select = (state, props) => ({ isResolvingEnteredRepost: props.repostUri && makeSelectIsUriResolving(`lbry://${props.repostUri}`)(state), activeChannelClaim: selectActiveChannelClaim(state), fetchingMyChannels: selectFetchingMyChannels(state), + incognito: selectIncognito(state), }); export default connect(select, { diff --git a/ui/component/repostCreate/view.jsx b/ui/component/repostCreate/view.jsx index f61394440..dfda5ae04 100644 --- a/ui/component/repostCreate/view.jsx +++ b/ui/component/repostCreate/view.jsx @@ -42,6 +42,7 @@ type Props = { isResolvingEnteredRepost: boolean, activeChannelClaim: ?ChannelClaim, fetchingMyChannels: boolean, + incognito: boolean, }; function RepostCreate(props: Props) { @@ -67,6 +68,7 @@ function RepostCreate(props: Props) { isResolvingEnteredRepost, activeChannelClaim, fetchingMyChannels, + incognito, } = props; const defaultName = name || (claim && claim.name) || ''; @@ -281,7 +283,7 @@ function RepostCreate(props: Props) { doRepost({ name: enteredRepostName, bid: creditsToString(repostBid), - channel_id: activeChannelClaim ? activeChannelClaim.claim_id : undefined, + channel_id: activeChannelClaim && !incognito ? activeChannelClaim.claim_id : undefined, claim_id: repostClaimId, }).then((repostClaim: StreamClaim) => { doCheckPendingClaims();