Skip to content

Commit

Permalink
Don't show "Edit" on pending reposts.
Browse files Browse the repository at this point in the history
  • Loading branch information
miko committed Dec 11, 2023
1 parent 4be6296 commit 45ab628
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ui/component/claimMenuList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -57,7 +58,7 @@ const select = (state, props) => {

return {
claim,
repostedClaim,
isRepost,
contentClaim,
contentSigningChannel,
contentChannelUri,
Expand Down
10 changes: 5 additions & 5 deletions ui/component/claimMenuList/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type SubscriptionArgs = {
type Props = {
uri: string,
claim: ?Claim,
repostedClaim: ?Claim,
isRepost: boolean,
contentClaim: ?Claim,
contentSigningChannel: ?Claim,
contentChannelUri: string,
Expand Down Expand Up @@ -79,7 +79,7 @@ function ClaimMenuList(props: Props) {
const {
uri,
claim,
repostedClaim,
isRepost,
contentClaim,
contentSigningChannel,
contentChannelUri,
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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}`)) });
Expand Down Expand Up @@ -556,7 +556,7 @@ function ClaimMenuList(props: Props) {
</div>
</MenuItem>
) */}
{!repostedClaim && (
{!isRepost && (
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.EDIT} />
Expand Down

0 comments on commit 45ab628

Please sign in to comment.