1
0
mirror of https://github.com/ppy/osu synced 2025-02-28 08:31:18 +00:00

Merge pull request from peppy/fix-status-config

Fix online status not persisting correctly
This commit is contained in:
Bartłomiej Dach 2024-07-29 16:11:05 +02:00 committed by GitHub
commit 48e38bd467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions
osu.Game
Online/API
Overlays/Login

View File

@ -118,12 +118,11 @@ namespace osu.Game.Online.API
u.OldValue?.Activity.UnbindFrom(activity); u.OldValue?.Activity.UnbindFrom(activity);
u.NewValue.Activity.BindTo(activity); u.NewValue.Activity.BindTo(activity);
if (u.OldValue != null) u.OldValue?.Status.UnbindFrom(localUserStatus);
localUserStatus.UnbindFrom(u.OldValue.Status); u.NewValue.Status.BindTo(localUserStatus);
localUserStatus.BindTo(u.NewValue.Status);
}, true); }, true);
localUserStatus.BindValueChanged(val => configStatus.Value = val.NewValue); localUserStatus.BindTo(configStatus);
var thread = new Thread(run) var thread = new Thread(run)
{ {
@ -600,6 +599,7 @@ namespace osu.Game.Online.API
password = null; password = null;
SecondFactorCode = null; SecondFactorCode = null;
authentication.Clear(); authentication.Clear();
configStatus.Value = UserStatus.Online;
// Scheduled prior to state change such that the state changed event is invoked with the correct user and their friends present // Scheduled prior to state change such that the state changed event is invoked with the correct user and their friends present
Schedule(() => Schedule(() =>

View File

@ -157,6 +157,7 @@ namespace osu.Game.Overlays.Login
}, },
}; };
updateDropdownCurrent(status.Value);
dropdown.Current.BindValueChanged(action => dropdown.Current.BindValueChanged(action =>
{ {
switch (action.NewValue) switch (action.NewValue)