From 35a162d013d9fee8182c385b382238d094264e5e Mon Sep 17 00:00:00 2001 From: HueByte Date: Sat, 21 Feb 2026 20:36:57 +0100 Subject: [PATCH] refactor: streamline audio service stop logic in AudioPlayerDialog --- src/EchoHub.Client/UI/AudioPlayerDialog.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/EchoHub.Client/UI/AudioPlayerDialog.cs b/src/EchoHub.Client/UI/AudioPlayerDialog.cs index ae21600..fd0d647 100644 --- a/src/EchoHub.Client/UI/AudioPlayerDialog.cs +++ b/src/EchoHub.Client/UI/AudioPlayerDialog.cs @@ -328,16 +328,10 @@ public sealed class AudioPlayerDialog closeButton.Accepting += (s, e) => { e.Handled = true; - Task.Run(async () => - { - await audioService.StopAsync(); - app.Invoke(() => - { - isDisposed = true; - animationTimer?.Dispose(); - app.RequestStop(); - }); - }); + isDisposed = true; + animationTimer?.Dispose(); + _ = audioService.StopAsync(); // fire-and-forget + app.RequestStop(); }; volDownButton.Accepting += (s, e) =>