a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[frontend/components] Only show profile bite button when Relations has CanBite

pancakes d6b3ee8d aeafa96a

+11 -2
+11 -2
Iceshrimp.Frontend/Components/ProfileInfo.razor
··· 70 70 <Text>@Loc["Edit profile"]</Text> 71 71 </MenuElement> 72 72 } 73 - else 73 + else if (UserProfile.Relations.HasFlag(Relations.CanBite)) 74 74 { 75 75 <MenuElement Icon="Icons.Tooth" OnSelect="Bite"> 76 76 <Text>@Loc["Bite"]</Text> ··· 264 264 265 265 private void EditProfile() => Nav.NavigateTo("/settings/profile"); 266 266 267 - private void Bite() => Api.Users.BiteUserAsync(User.Id); 267 + private async Task Bite() { 268 + try { 269 + await Api.Users.BiteUserAsync(User.Id); 270 + await GlobalComponentSvc.NoticeDialog?.Display(Loc["Bit {0}", User.DisplayName ?? User.Username])!; 271 + } 272 + catch (ApiException e) 273 + { 274 + await GlobalComponentSvc.NoticeDialog?.Display(e.Response.Message ?? Loc["Unable to bite {0}", User.DisplayName ?? User.Username], NoticeDialog.NoticeType.Error)!; 275 + } 276 + } 268 277 269 278 private async Task RemoveFromFollowersAction(bool confirm) 270 279 {