Used OnAfterRender instead of OnInitialized
This commit is contained in:
@@ -11,9 +11,8 @@
|
|||||||
|
|
||||||
private int UserCount;
|
private int UserCount;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
UserCount = UserRepository.Get().Count();
|
UserCount = UserRepository.Get().Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
private int ServerCount;
|
private int ServerCount;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
ServerCount = ServerRepository.Get().Count();
|
ServerCount = ServerRepository.Get().Count();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
private int ServerCount = 0;
|
private int ServerCount = 0;
|
||||||
private int NetworksCount = 0;
|
private int NetworksCount = 0;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
|
|
||||||
ServerCount = await ServerRepository.Get().Where(x => x.Owner == IdentityService.CurrentUser).CountAsync();
|
ServerCount = await ServerRepository.Get().Where(x => x.Owner == IdentityService.CurrentUser).CountAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user