Merge branch 'player-minimize-sync' into dev
This commit is contained in:
@@ -115,13 +115,22 @@ public partial class AudioPlayerBar : ComponentBase, IAsyncDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Expand()
|
||||
private async Task Expand() => await SetMinimized(false);
|
||||
|
||||
/// <summary>
|
||||
/// The single assignment site for <see cref="_isMinimized"/>. Guards no-op transitions,
|
||||
/// fires <see cref="OnMinimized"/> so MainLayout's spacer class stays in sync, and renders
|
||||
/// so OnAfterRenderAsync re-evaluates the ResizeObserver on every transition path.
|
||||
/// The <c>Fixed</c> branch in OnParametersSet intentionally bypasses this — it is a
|
||||
/// prerender/parameter pass, not a user-driven transition, and the embed host has no spacer.
|
||||
/// </summary>
|
||||
private async Task SetMinimized(bool value)
|
||||
{
|
||||
if (_isMinimized)
|
||||
{
|
||||
_isMinimized = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
if (_isMinimized == value) return;
|
||||
|
||||
_isMinimized = value;
|
||||
if (OnMinimized.HasDelegate) await OnMinimized.InvokeAsync(value);
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task TogglePlayPause()
|
||||
@@ -176,12 +185,7 @@ public partial class AudioPlayerBar : ComponentBase, IAsyncDisposable
|
||||
PlayerService?.ClearError();
|
||||
}
|
||||
|
||||
private async Task ToggleMinimized()
|
||||
{
|
||||
_isMinimized = !_isMinimized;
|
||||
if (OnMinimized.HasDelegate) await OnMinimized.InvokeAsync(_isMinimized);
|
||||
StateHasChanged();
|
||||
}
|
||||
private async Task ToggleMinimized() => await SetMinimized(!_isMinimized);
|
||||
|
||||
private async Task Close()
|
||||
{
|
||||
@@ -190,11 +194,7 @@ public partial class AudioPlayerBar : ComponentBase, IAsyncDisposable
|
||||
await PlayerService.Unload();
|
||||
}
|
||||
|
||||
if (!_isMinimized)
|
||||
{
|
||||
_isMinimized = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
await SetMinimized(true);
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
|
||||
Reference in New Issue
Block a user