mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Fix “Unblock” and “Unmute” actions being disabled when blocked (#38075)
This commit is contained in:
@@ -129,6 +129,8 @@ export const FollowButton: React.FC<{
|
||||
: messages.follow;
|
||||
|
||||
let label;
|
||||
let disabled =
|
||||
relationship?.blocked_by || account?.suspended || !!account?.moved;
|
||||
|
||||
if (!signedIn) {
|
||||
label = intl.formatMessage(followMessage);
|
||||
@@ -138,12 +140,16 @@ export const FollowButton: React.FC<{
|
||||
label = <LoadingIndicator />;
|
||||
} else if (relationship.muting) {
|
||||
label = intl.formatMessage(messages.unmute);
|
||||
disabled = false;
|
||||
} else if (relationship.following) {
|
||||
label = intl.formatMessage(messages.unfollow);
|
||||
disabled = false;
|
||||
} else if (relationship.blocking) {
|
||||
label = intl.formatMessage(messages.unblock);
|
||||
disabled = false;
|
||||
} else if (relationship.requested) {
|
||||
label = intl.formatMessage(messages.followRequestCancel);
|
||||
disabled = false;
|
||||
} else if (relationship.followed_by && !account?.locked) {
|
||||
label = intl.formatMessage(messages.followBack);
|
||||
} else {
|
||||
@@ -168,11 +174,7 @@ export const FollowButton: React.FC<{
|
||||
return (
|
||||
<Button
|
||||
onClick={handleClick}
|
||||
disabled={
|
||||
relationship?.blocked_by ||
|
||||
(!(relationship?.following || relationship?.requested) &&
|
||||
(account?.suspended || !!account?.moved))
|
||||
}
|
||||
disabled={disabled}
|
||||
secondary={following}
|
||||
compact={compact}
|
||||
className={classNames(className, { 'button--destructive': following })}
|
||||
|
||||
Reference in New Issue
Block a user