refactoring, enhancements, and some fixes

This commit is contained in:
Shaun Walker
2021-06-10 08:16:02 -04:00
parent 82c05a841f
commit bc720555c4
30 changed files with 436 additions and 244 deletions

View File

@ -1,4 +1,6 @@
@inject IInstallationService InstallationService
@inject IJSRuntime JSRuntime
@inject SiteState SiteState
@if (_initialized)
{
@ -20,21 +22,28 @@
{
<div class="app-alert">
@_installation.Message
</div>
</div>
}
}
}
@code {
private Installation _installation;
private bool _initialized;
private bool _initialized = false;
private Installation _installation = new Installation { Success = false, Message = "" };
private PageState PageState { get; set; }
protected override async Task OnParametersSetAsync()
protected override async Task OnAfterRenderAsync(bool firstRender)
{
_installation = await InstallationService.IsInstalled();
_initialized = true;
if (firstRender && !_initialized)
{
var interop = new Interop(JSRuntime);
SiteState.AntiForgeryToken = await interop.GetElementByName(Constants.RequestVerificationToken);
_installation = await InstallationService.IsInstalled();
SiteState.Alias = _installation.Alias;
_initialized = true;
StateHasChanged();
}
}
private void ChangeState(PageState pageState)