mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
refactor: streamline audio service stop logic in AudioPlayerDialog
This commit is contained in:
@@ -328,16 +328,10 @@ public sealed class AudioPlayerDialog
|
|||||||
closeButton.Accepting += (s, e) =>
|
closeButton.Accepting += (s, e) =>
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
Task.Run(async () =>
|
isDisposed = true;
|
||||||
{
|
animationTimer?.Dispose();
|
||||||
await audioService.StopAsync();
|
_ = audioService.StopAsync(); // fire-and-forget
|
||||||
app.Invoke(() =>
|
app.RequestStop();
|
||||||
{
|
|
||||||
isDisposed = true;
|
|
||||||
animationTimer?.Dispose();
|
|
||||||
app.RequestStop();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
volDownButton.Accepting += (s, e) =>
|
volDownButton.Accepting += (s, e) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user