Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Merge pull request #1552 from ecency/feature/not-follow-yourself
Browse files Browse the repository at this point in the history
Hide follow button for current user
  • Loading branch information
feruzm authored Feb 14, 2024
2 parents 329cea8 + bd6fbc9 commit 321ce2d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ exports[`(1) Default render 1`] = `
</div>
<div
className="editor-tool"
id="editor-tool-emoji-picker-68604c33-4900-4fa5-b2f2-e4dd9f41baf3"
id="editor-tool-emoji-picker-525d9194-2e44-4e7a-9e86-ef2e448c455a"
role="none"
title="Emoji"
>
Expand Down Expand Up @@ -552,7 +552,7 @@ exports[`(2) Cancellable, in progress 1`] = `
</div>
<div
className="editor-tool"
id="editor-tool-emoji-picker-34fbf304-db64-48ef-9d45-246ff8a667d4"
id="editor-tool-emoji-picker-1dfb459c-12aa-465e-b119-bf96521d112c"
role="none"
title="Emoji"
>
Expand Down
21 changes: 13 additions & 8 deletions src/common/components/follow-controls/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ export default class FollowControls extends BaseComponent<Props, State> {
const muteMsg = _t("follow-controls.mute");
const unMuteMsg = _t("follow-controls.unMute");

const btnFollow = LoginRequired({
...this.props,
children: (
<Button style={{ marginRight: "5px" }} disabled={inProgress} onClick={this.follow}>
{followMsg}
</Button>
)
});
const btnFollow =
this.props.activeUser?.username !== this.props.targetUsername ? (
LoginRequired({
...this.props,
children: (
<Button style={{ marginRight: "5px" }} disabled={inProgress} onClick={this.follow}>
{followMsg}
</Button>
)
})
) : (
<></>
);

const btnUnfollow = LoginRequired({
...this.props,
Expand Down

0 comments on commit 321ce2d

Please sign in to comment.