Fix audio preview buttons not correctly handling load failure states

Closes #4593.
This commit is contained in:
Dean Herbert
2019-05-23 12:07:22 +09:00
parent 0e8517ebae
commit 372c5b081c
2 changed files with 24 additions and 11 deletions

View File

@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Direct
if (Preview != null)
{
Preview.Start();
attemptStart();
return;
}
@ -147,7 +147,7 @@ namespace osu.Game.Overlays.Direct
// user may have changed their mind.
if (Playing.Value)
preview.Start();
attemptStart();
});
}
else
@ -157,6 +157,12 @@ namespace osu.Game.Overlays.Direct
}
}
private void attemptStart()
{
if (Preview?.Start() != true)
Playing.Value = false;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);