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/compoents] Only show note bite button if CanBite is true

pancakes 7630d1f8 5c74927e

+12 -3
+12 -3
Iceshrimp.Frontend/Components/Note/NoteFooter.razor
··· 1 1 @using Iceshrimp.Assets.PhosphorIcons 2 + @using Iceshrimp.Frontend.Core.Miscellaneous 2 3 @using Iceshrimp.Frontend.Core.Services 3 4 @using Iceshrimp.Frontend.Core.Services.NoteStore 4 5 @using Iceshrimp.Frontend.Localization ··· 97 98 <button @ref="MenuButton" class="btn" @onclick="ToggleMenu" @onclick:stopPropagation="true" aria-label="more"> 98 99 <Icon Name="Icons.DotsThreeOutline" Size="1.3em"/> 99 100 <Menu @ref="ContextMenu"> 100 - @if (Note.User.Id != Session.Current?.Id) 101 + @if (Note.CanBite) 101 102 { 102 103 <MenuElement Icon="Icons.Tooth" OnSelect="Bite"> 103 104 <Text>@Loc["Bite"]</Text> ··· 263 264 _ = NoteActions.RedraftAsync(Note); 264 265 } 265 266 266 - private void Bite() 267 + private async Task Bite() 267 268 { 268 - _ = NoteActions.BiteAsync(Note); 269 + try 270 + { 271 + await NoteActions.BiteAsync(Note); 272 + await GlobalComponentSvc.NoticeDialog?.Display(Loc["Bit {0}", Note.User.DisplayName ?? Note.User.Username])!; 273 + } 274 + catch (ApiException e) 275 + { 276 + await GlobalComponentSvc.NoticeDialog?.Display(e.Response.Message ?? Loc["Unable to bite {0}", Note.User.DisplayName ?? Note.User.Username], NoticeDialog.NoticeType.Error)!; 277 + } 269 278 } 270 279 271 280 private void Mute()