Cleanup & Bug Fixes

- WebAssembly fix (missing app.Run)
 - API comms cleanup
This commit is contained in:
daniel-c-harvey
2025-09-08 09:53:13 -04:00
parent 4f7b37813a
commit c6f4ffc1fe
13 changed files with 75 additions and 32 deletions
+12 -1
View File
@@ -1,4 +1,5 @@
@page "/tracks"
@page "/tracks"
@rendermode @(new InteractiveAutoRenderMode(prerender: false))
@using DeepDrftWeb.Client.Controls
@@ -19,6 +20,16 @@
SelectedChanged="@SetPage"
BoundaryCount="2"
MiddleCount="3"/>
<div class="interactivity-test mt-4">
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="TestInteractivity">
Test Interactivity (@_clickCount)
</MudButton>
<MudText Typo="Typo.body2" Class="mt-2">
Lifecycle Status: @_lifecycleStatus
</MudText>
</div>
<AudioPlayerBar AudioPlaybackEngine="AudioPlaybackEngine" />
</div>
}
+20 -4
View File
@@ -1,4 +1,4 @@
using DeepDrftModels.Entities;
using DeepDrftModels.Entities;
using DeepDrftModels.Models;
using DeepDrftWeb.Client.Services;
using DeepDrftWeb.Client.ViewModels;
@@ -12,13 +12,29 @@ public partial class TracksView : ComponentBase
[Inject] public required AudioPlaybackEngine AudioPlaybackEngine { get; set; }
private TrackEntity? _selectedTrack = null;
private int _clickCount = 0;
private string _lifecycleStatus = "Not initialized";
protected override async Task OnInitializedAsync()
{
_lifecycleStatus = "OnInitializedAsync called";
await SetPage(1);
if (!RendererInfo.IsInteractive) return;
await AudioPlaybackEngine.InitializeAudioPlayer();
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
_lifecycleStatus = "OnAfterRenderAsync called - WebAssembly is active!";
await AudioPlaybackEngine.InitializeAudioPlayer();
StateHasChanged();
}
}
private void TestInteractivity()
{
_clickCount++;
_lifecycleStatus = $"Button clicked {_clickCount} times - Interactivity working!";
}
private async Task SetPage(int newPage)