fix(ui): defer secure API call on library page to prevent 401 on server pre-rendering
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user