Skip to content

Commit

Permalink
Added message when no content available (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
csharpfritz authored Mar 26, 2024
1 parent 6812f9a commit a30f432
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/TagzApp.Blazor.Client/Components/Pages/Moderation.razor
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@
</div>

}
else
else if (_Loading)
{
<div class=" d-flex justify-content-center align-items-center" style="height: calc(100vh - 210px); text-align: center;">
<div class="spinner-border" role="status"> <span class="visually-hidden">Loading...</span> </div>
</div>
} else {
<div class=" d-flex justify-content-center align-items-center" style="height: calc(100vh - 210px); text-align: center;">
<div class="alert alert-danger" role="status"> No messages found that meet the filter criteria</div>
</div>
}

<PauseButton @ref="ThePauseButton" OnPauseUpdates="OnPauseClick" />
Expand Down Expand Up @@ -119,6 +123,7 @@
private IEnumerable<AvailableProvider> _Providers = Enumerable.Empty<AvailableProvider>();

private List<string> _FilteredProviders = [];
private bool _Loading = true;

private FilterModerationState _FilterApprovalStatus = FilterModerationState.All;
private FilterModerationState FilterApprovalStatus
Expand All @@ -127,9 +132,11 @@
set
{
_FilterApprovalStatus = value;
_Loading = true;
_Content.Clear();
StateHasChanged();
FilterContent = InitializeContent().ContinueWith(async t => {
_Loading = false;
await InvokeAsync(StateHasChanged);
FilterContent = null;
});
Expand Down Expand Up @@ -335,6 +342,8 @@
_Content.Add(content.Timestamp, content);
}

_Loading = false;

}

public async Task Moderate(ModerationAction action)
Expand Down Expand Up @@ -380,8 +389,10 @@
}

_Content.Clear();
_Loading = true;
StateHasChanged();
FilterContent = InitializeContent().ContinueWith(async t => {
_Loading = false;
await InvokeAsync(StateHasChanged);
FilterContent = null;
});
Expand Down

0 comments on commit a30f432

Please sign in to comment.