Merge pull request #1666 from sbwalker/dev
fix #1640 - prevent UX "flicker" which was caused by pre-rendering
This commit is contained in:
commit
f052f6696f
|
@ -4,31 +4,40 @@
|
||||||
|
|
||||||
@if (_initialized)
|
@if (_initialized)
|
||||||
{
|
{
|
||||||
@if (!_installation.Success)
|
<div style="@_display">
|
||||||
{
|
@if (!_installation.Success)
|
||||||
<Installer />
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@if (string.IsNullOrEmpty(_installation.Message))
|
|
||||||
{
|
{
|
||||||
<CascadingAuthenticationState>
|
<Installer />
|
||||||
<CascadingValue Value="@PageState">
|
|
||||||
<SiteRouter OnStateChange="@ChangeState" />
|
|
||||||
</CascadingValue>
|
|
||||||
</CascadingAuthenticationState>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="app-alert">
|
@if (string.IsNullOrEmpty(_installation.Message))
|
||||||
@_installation.Message
|
{
|
||||||
</div>
|
<CascadingAuthenticationState>
|
||||||
|
<CascadingValue Value="@PageState">
|
||||||
|
<SiteRouter OnStateChange="@ChangeState" />
|
||||||
|
</CascadingValue>
|
||||||
|
</CascadingAuthenticationState>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="app-alert">
|
||||||
|
@_installation.Message
|
||||||
|
</div>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public string Runtime { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string RenderMode { get; set; }
|
||||||
|
|
||||||
private bool _initialized = false;
|
private bool _initialized = false;
|
||||||
|
private string _display = "display: none;";
|
||||||
private Installation _installation = new Installation { Success = false, Message = "" };
|
private Installation _installation = new Installation { Success = false, Message = "" };
|
||||||
|
|
||||||
private PageState PageState { get; set; }
|
private PageState PageState { get; set; }
|
||||||
|
@ -53,6 +62,8 @@
|
||||||
{
|
{
|
||||||
var interop = new Interop(JSRuntime);
|
var interop = new Interop(JSRuntime);
|
||||||
SiteState.AntiForgeryToken = await interop.GetElementByName(Constants.RequestVerificationToken);
|
SiteState.AntiForgeryToken = await interop.GetElementByName(Constants.RequestVerificationToken);
|
||||||
|
_display = "";
|
||||||
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<body>
|
<body>
|
||||||
@(Html.AntiForgeryToken())
|
@(Html.AntiForgeryToken())
|
||||||
<app>
|
<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>
|
</app>
|
||||||
|
|
||||||
<div id="blazor-error-ui">
|
<div id="blazor-error-ui">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user