Improved AccountLayout

This commit is contained in:
Mia Rose Winter 2024-01-17 21:14:10 +01:00
parent db1a4bba60
commit 888691ed9f
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 9 additions and 13 deletions

View file

@ -2,12 +2,9 @@
@layout Wave.Components.Layout.MainLayout
@inject NavigationManager NavigationManager
@if (HttpContext is null)
{
<p>Loading...</p>
}
else
{
@if (HttpContext is null) {
<span class="loading loading-spinner loading-lg"></span>
} else {
@Body
}
@ -15,14 +12,13 @@ else
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
protected override void OnParametersSet()
{
if (HttpContext is null)
{
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);
}
}
}

File diff suppressed because one or more lines are too long