[frontend/pages] Improve state handling for no emojis

This commit is contained in:
pancakes 2025-03-07 19:53:09 +10:00 committed by Laura Hausmann
parent af580eeed1
commit be16fe8e5d
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 4 additions and 4 deletions

View file

@ -57,9 +57,9 @@
</div> </div>
} }
} }
@if (State is State.Empty) @if (State is State.Empty || (State is State.Loaded && Categories.Count == 0))
{ {
<i>This instance has no emojis</i> @Loc["No emojis were found"]
} }
@if (State is State.Loading) @if (State is State.Loading)
{ {

View file

@ -49,7 +49,7 @@
} }
@if (State is State.Empty) @if (State is State.Empty)
{ {
<i>This instance hasn't received remote emojis</i> <i>@Loc["No emojis were found"]</i>
} }
@if (State is State.Loading) @if (State is State.Loading)
{ {
@ -73,7 +73,7 @@
PaginationData = res.Links; PaginationData = res.Links;
Emojis = res.Data; Emojis = res.Data;
State = State.Loaded; State = Emojis.Count == 0 ? State.Empty : State.Loaded;
StateHasChanged(); StateHasChanged();
} }