Cleanup & Bug Fixes
- WebAssembly fix (missing app.Run) - API comms cleanup
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user