Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added message when no content available #433

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading