Update `APIState` checks

This commit is contained in:
Dean Herbert 2023-11-16 20:39:23 +09:00
parent 167f5b4ef4
commit 7472dc9bb5
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -79,10 +80,14 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
case APIState.Failing:
case APIState.Connecting:
case APIState.RequiresSecondFactorAuth:
PopContentOut(Content);
LoadingSpinner.Show();
placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
break;
default:
throw new ArgumentOutOfRangeException();
}
});

View File

@ -3,6 +3,7 @@
#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -118,12 +119,16 @@ private void apiStateChanged(ValueChangedEvent<APIState> state)
break;
case APIState.Connecting:
case APIState.RequiresSecondFactorAuth:
break;
case APIState.Online:
scheduledHide?.Cancel();
scheduledHide = Schedule(Hide);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}