Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix - Don't show "Edit" on pending reposts. #3029

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading