[frontend/components] Don't show Follow button for yourself

This commit is contained in:
pancakes 2024-11-16 18:35:15 +10:00 committed by Laura Hausmann
parent 3dfc7c6b63
commit 60ed8d3c3c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -5,6 +5,8 @@
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@inject IStringLocalizer<Localization> Loc; @inject IStringLocalizer<Localization> Loc;
@inject ApiService Api; @inject ApiService Api;
@if (_buttonType == ButtonType.Self) return;
<span class="follow-button"> <span class="follow-button">
@switch (_buttonType) @switch (_buttonType)
{ {
@ -51,7 +53,8 @@
Unfollow, Unfollow,
FollowBack, FollowBack,
FollowLocked, FollowLocked,
CancelRequest CancelRequest,
Self
} }
private void Action() private void Action()
@ -110,5 +113,10 @@
{ {
_buttonType = ButtonType.CancelRequest; _buttonType = ButtonType.CancelRequest;
} }
if (UserProfile.Relations.HasFlag(Relations.Self))
{
_buttonType = ButtonType.Self;
}
} }
} }