fix(ui): defer secure API call on library page to prevent 401 on server pre-rendering

This commit is contained in:
2026-05-19 20:14:04 +02:00
parent 720a5e6091
commit 1f48d36d9c
2 changed files with 5 additions and 5 deletions
@@ -122,14 +122,11 @@ public class KnowledgeService : IKnowledgeService
}
catch (Exception)
{
// Evict from active dictionary on hard exceptions to ensure system resiliency
_activeRequests.TryRemove(requestKey, out _);
throw;
}
finally
{
// Once a task successfully finishes and persists to the Persistent Database Cache,
// we evict it from RAM (_activeRequests) since future hits will leverage the DB cache.
_activeRequests.TryRemove(requestKey, out _);
}
}
@@ -508,9 +508,12 @@
private bool _isLoading = true;
private List<LastReadBookDto>? _books;
protected override async Task OnInitializedAsync()
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await LoadBooksAsync();
if (firstRender)
{
await LoadBooksAsync();
}
}
private async Task LoadBooksAsync()