fix: resolve dashboard bugs (percentage precision, wrong title, and reading resumption)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
@inject IQuizStateService QuizState
|
||||
@inject IFocusModeService FocusMode
|
||||
@inject IJSRuntime JS
|
||||
@inject NavigationManager NavManager
|
||||
@inject IReaderNavigationService NavService
|
||||
<PageTitle>Nexus E-Reader</PageTitle>
|
||||
|
||||
<div class="home-reader-container">
|
||||
@@ -26,6 +28,16 @@
|
||||
QuizState.OnQuizRequested += HandleQuizRequestedAsync;
|
||||
FocusMode.OnFocusModeChanged += HandleUpdate;
|
||||
await FocusMode.InitializeAsync();
|
||||
|
||||
// Handle deep-linking to a specific chapter
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue("chapter", out var chapterValue))
|
||||
{
|
||||
if (int.TryParse(chapterValue, out var chapterIndex))
|
||||
{
|
||||
await NavService.GoToChapter(chapterIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
|
||||
Reference in New Issue
Block a user