mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 22:23:12 +00:00
28 lines
762 B
Text
28 lines
762 B
Text
@inherits LayoutComponentBase
|
|
@layout SeaHavenIndustries.Components.Layout.MainLayout
|
|
@inject NavigationManager NavigationManager
|
|
|
|
@if (HttpContext is null)
|
|
{
|
|
<p>Loading...</p>
|
|
}
|
|
else
|
|
{
|
|
@Body
|
|
}
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
private HttpContext? HttpContext { get; set; }
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
if (HttpContext is null)
|
|
{
|
|
// If this code runs, we're currently rendering in interactive mode, so there is no HttpContext.
|
|
// The identity pages need to set cookies, so they require an HttpContext. To achieve this we
|
|
// must transition back from interactive mode to a server-rendered page.
|
|
NavigationManager.Refresh(forceReload: true);
|
|
}
|
|
}
|
|
}
|