Used OnAfterRender instead of OnInitialized

This commit is contained in:
Moritz Deiaco
2024-05-30 14:13:42 +02:00
parent 09dffe020d
commit 20d0e1c8eb
3 changed files with 3 additions and 4 deletions

View File

@@ -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();
} }
} }

View File

@@ -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();
} }

View File

@@ -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();