1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 09:22:54 +08:00

Fix listing polling rate when entering room

This commit is contained in:
smoogipoo 2021-08-13 18:17:18 +09:00
parent 1bae7173d3
commit 1f992e67f3

View File

@ -184,7 +184,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
listingPollingComponent.HasPolledOnce.BindValueChanged(_ => updateLoadingLayer());
isIdle.BindValueChanged(_ => updatePollingRate(), true);
isIdle.BindValueChanged(_ => updatePollingRate(this.IsCurrentScreen()), true);
if (ongoingOperationTracker != null)
{
@ -272,13 +272,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
private void onReturning()
{
updatePollingRate();
updatePollingRate(true);
searchTextBox.HoldFocus = true;
}
private void onLeaving()
{
updatePollingRate();
updatePollingRate(false);
searchTextBox.HoldFocus = false;
// ensure any password prompt is dismissed.
@ -332,9 +332,9 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
loadingLayer.Hide();
}
private void updatePollingRate()
private void updatePollingRate(bool isCurrentScreen)
{
if (!this.IsCurrentScreen())
if (!isCurrentScreen)
listingPollingComponent.TimeBetweenPolls.Value = 0;
else
listingPollingComponent.TimeBetweenPolls.Value = isIdle.Value ? 120000 : 15000;