Merge pull request #1666 from sbwalker/dev

fix #1640 - prevent UX "flicker" which was caused by pre-rendering
This commit is contained in:
Shaun Walker 2021-09-17 08:41:44 -04:00 committed by GitHub
commit f052f6696f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 17 deletions

View File

@ -4,6 +4,7 @@
@if (_initialized)
{
<div style="@_display">
@if (!_installation.Success)
{
<Installer />
@ -25,10 +26,18 @@
</div>
}
}
</div>
}
@code {
[Parameter]
public string Runtime { get; set; }
[Parameter]
public string RenderMode { get; set; }
private bool _initialized = false;
private string _display = "display: none;";
private Installation _installation = new Installation { Success = false, Message = "" };
private PageState PageState { get; set; }
@ -53,6 +62,8 @@
{
var interop = new Interop(JSRuntime);
SiteState.AntiForgeryToken = await interop.GetElementByName(Constants.RequestVerificationToken);
_display = "";
StateHasChanged();
}
}

View File

@ -20,7 +20,7 @@
<body>
@(Html.AntiForgeryToken())
<app>
<component type="typeof(Oqtane.App)" render-mode="@Model.RenderMode" />
<component type="typeof(Oqtane.App)" render-mode="@Model.RenderMode" param-Runtime="@Model.Runtime" param-RenderMode="@Model.RenderMode.ToString()" />
</app>
<div id="blazor-error-ui">