fix: ensure user-specific ebook tracking and auto-provisioning for progress sync
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user