fix: TrackDetail render mode, pause, and secondary text color

This commit is contained in:
daniel-c-harvey
2026-06-06 16:45:07 -04:00
parent 0dd33a5dfc
commit 93d9b47a67
2 changed files with 7 additions and 5 deletions
@@ -1,5 +1,4 @@
@page "/track/{EntryKey}"
@rendermode InteractiveWebAssembly
<PageTitle>@(ViewModel.Track?.TrackName ?? "Track") - DeepDrft</PageTitle>
@@ -24,7 +23,7 @@ else if (ViewModel.NotFound)
<div class="deepdrft-track-detail-container">
<div class="deepdrft-track-detail-masthead">
<MudText Typo="Typo.h4" Align="Align.Center">Track not found.</MudText>
<MudText Typo="Typo.body2" Align="Align.Center" Class="mud-text-secondary">
<MudText Typo="Typo.body2" Align="Align.Center" Color="Color.Secondary">
This track may have been moved or removed.
</MudText>
<div class="d-flex justify-center mt-4">
@@ -67,9 +67,12 @@ public partial class TrackDetail : ComponentBase, IDisposable
{
if (ViewModel.Track is null) return;
// Resume the current track if it's merely paused; otherwise stream the new selection.
// SelectTrackStreaming is the live entry point — the buffered SelectTrack path is dead.
if (PlayerService.CurrentTrack?.Id == ViewModel.Track.Id && PlayerService.IsPaused)
var isThisTrack = PlayerService.CurrentTrack?.Id == ViewModel.Track.Id;
// Toggle play/pause if this track is already the active one (playing or paused);
// otherwise start a fresh stream. SelectTrackStreaming is the live entry point —
// the buffered SelectTrack path is dead.
if (isThisTrack && (PlayerService.IsPlaying || PlayerService.IsPaused))
{
await PlayerService.TogglePlayPause();
}