From c2604e3cbaae1a2cb8bd5181eb5e81edf387eea5 Mon Sep 17 00:00:00 2001 From: miko <34790748+keikari@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:10:03 +0200 Subject: [PATCH] Don't show "Edit" on pending reposts. (#3029) Co-authored-by: miko --- ui/component/claimMenuList/index.js | 5 +++-- ui/component/claimMenuList/view.jsx | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/component/claimMenuList/index.js b/ui/component/claimMenuList/index.js index 7623fc3c23..3b373ae72f 100644 --- a/ui/component/claimMenuList/index.js +++ b/ui/component/claimMenuList/index.js @@ -42,7 +42,8 @@ const select = (state, props) => { const { uri } = props; const claim = selectClaimForUri(state, uri, false); const collectionId = props.collectionId; - const repostedClaim = claim && claim.reposted_claim; + const repostedClaim = claim?.reposted_claim; + const isRepost = Boolean(claim?.reposted_claim || claim?.value?.claim_hash); const contentClaim = repostedClaim || claim; const contentSigningChannel = contentClaim && contentClaim.signing_channel; const contentPermanentUri = contentClaim && contentClaim.permanent_url; @@ -57,7 +58,7 @@ const select = (state, props) => { return { claim, - repostedClaim, + isRepost, contentClaim, contentSigningChannel, contentChannelUri, diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index 51c1d22c98..b6fa219155 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -31,7 +31,7 @@ type SubscriptionArgs = { type Props = { uri: string, claim: ?Claim, - repostedClaim: ?Claim, + isRepost: boolean, contentClaim: ?Claim, contentSigningChannel: ?Claim, contentChannelUri: string, @@ -79,7 +79,7 @@ function ClaimMenuList(props: Props) { const { uri, claim, - repostedClaim, + isRepost, contentClaim, contentSigningChannel, contentChannelUri, @@ -133,7 +133,7 @@ function ClaimMenuList(props: Props) { const isChannel = !incognitoClaim && !contentSigningChannel; const { channelName } = parseURI(contentChannelUri); const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)); - const subscriptionLabel = repostedClaim + const subscriptionLabel = isRepost ? isSubscribed ? __('Unfollow @%channelName%', { channelName }) : __('Follow @%channelName%', { channelName }) @@ -215,7 +215,7 @@ function ClaimMenuList(props: Props) { */ function handleDelete() { - if (!repostedClaim && !isChannel) { + if (!isRepost && !isChannel) { openModal(MODALS.CONFIRM_FILE_REMOVE, { uri, doGoBack: false }); } else { openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: isChannel && (() => replace(`/$/${PAGES.CHANNELS}`)) }); @@ -556,7 +556,7 @@ function ClaimMenuList(props: Props) { ) */} - {!repostedClaim && ( + {!isRepost && (