Skip to content

Commit

Permalink
set pagetitle before first render
Browse files Browse the repository at this point in the history
Signed-off-by: David Hernando <[email protected]>
  • Loading branch information
davidatwhiletrue committed Jul 10, 2024
1 parent 072b60b commit 55141b2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Docs/Demos/NCTLWebExplorer/Shared/MainLayout.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ public partial class MainLayout
private bool sidebarExpanded = true;

private string _PageTitle = "Casper Mini explorer";

protected override async Task OnInitializedAsync()
{
if (Config["PageTitle"] != null)
_PageTitle = Config["PageTitle"];
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await GetNodeStatus();

if (Config["PageTitle"] != null)
_PageTitle = Config["PageTitle"];

StateHasChanged();
}
}
Expand Down

0 comments on commit 55141b2

Please sign in to comment.