mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix overlay accepting state changes while hidden
This commit is contained in:
@ -81,7 +81,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
base.PopIn();
|
base.PopIn();
|
||||||
|
|
||||||
// We don't want to create new display on every call, only when exiting from fully closed state.
|
// We don't want to create a new display on every call, only when exiting from fully closed state.
|
||||||
if (displayUpdateRequired)
|
if (displayUpdateRequired)
|
||||||
{
|
{
|
||||||
header.Current.TriggerChange();
|
header.Current.TriggerChange();
|
||||||
@ -102,7 +102,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
LoadComponentAsync(display, loaded =>
|
LoadComponentAsync(display, loaded =>
|
||||||
{
|
{
|
||||||
loading.Hide();
|
if (API.IsLoggedIn)
|
||||||
|
loading.Hide();
|
||||||
|
|
||||||
content.Child = loaded;
|
content.Child = loaded;
|
||||||
}, (cancellationToken = new CancellationTokenSource()).Token);
|
}, (cancellationToken = new CancellationTokenSource()).Token);
|
||||||
}
|
}
|
||||||
@ -110,9 +112,14 @@ namespace osu.Game.Overlays
|
|||||||
private void onTabChanged(ValueChangedEvent<DashboardOverlayTabs> tab)
|
private void onTabChanged(ValueChangedEvent<DashboardOverlayTabs> tab)
|
||||||
{
|
{
|
||||||
cancellationToken?.Cancel();
|
cancellationToken?.Cancel();
|
||||||
|
|
||||||
loading.Show();
|
loading.Show();
|
||||||
|
|
||||||
|
if (!API.IsLoggedIn)
|
||||||
|
{
|
||||||
|
loadDisplay(Empty());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (tab.NewValue)
|
switch (tab.NewValue)
|
||||||
{
|
{
|
||||||
case DashboardOverlayTabs.Friends:
|
case DashboardOverlayTabs.Friends:
|
||||||
@ -126,19 +133,10 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public override void APIStateChanged(IAPIProvider api, APIState state)
|
public override void APIStateChanged(IAPIProvider api, APIState state)
|
||||||
{
|
{
|
||||||
switch (state)
|
if (State.Value == Visibility.Hidden)
|
||||||
{
|
return;
|
||||||
case APIState.Online:
|
|
||||||
// Will force to create a display based on visibility state
|
|
||||||
displayUpdateRequired = true;
|
|
||||||
State.TriggerChange();
|
|
||||||
return;
|
|
||||||
|
|
||||||
default:
|
header.Current.TriggerChange();
|
||||||
content.Clear();
|
|
||||||
loading.Show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Reference in New Issue
Block a user