fix: ensure user-specific ebook tracking and auto-provisioning for progress sync

This commit is contained in:
2026-05-10 18:37:32 +02:00
parent 652e74c2f5
commit 2950e15633
7 changed files with 35 additions and 13 deletions
@@ -11,6 +11,8 @@
@inject KnowledgeCoordinator Coordinator
@inject IReaderInteractionService InteractionService
@inject ISyncService SyncService
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthStateProvider
<div class="reader-canvas @(ThemeService.IsLightMode ? "theme-light" : "theme-dark")">
@if (ViewModel == null)
@@ -190,7 +192,10 @@
ViewModel = null;
StatusMessage = "Fetching content...";
var result = await Mediator.Send(new GetReaderPageQuery(index));
var authState = await AuthStateProvider.GetAuthenticationStateAsync();
var userId = authState.User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value;
var result = await Mediator.Send(new GetReaderPageQuery(index, userId));
if (result.IsSuccess)
{
ViewModel = result.Value;