1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:02:55 +08:00

Revert "clear remembered username when checkbox is unticked"

This reverts commit d01421b951.
This commit is contained in:
Bartłomiej Dach 2024-02-22 09:40:27 +01:00
parent 2831ff60e1
commit a1046f0a86
No known key found for this signature in database

View File

@ -13,11 +13,11 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Overlays.Settings;
using osu.Game.Resources.Localisation.Web;
using osuTK;
using osu.Game.Localisation;
namespace osu.Game.Overlays.Login
{
@ -26,7 +26,6 @@ namespace osu.Game.Overlays.Login
private TextBox username = null!;
private TextBox password = null!;
private ShakeContainer shakeSignIn = null!;
private SettingsCheckbox rememberUsername = null!;
[Resolved]
private IAPIProvider api { get; set; } = null!;
@ -83,7 +82,7 @@ namespace osu.Game.Overlays.Login
},
},
},
rememberUsername = new SettingsCheckbox
new SettingsCheckbox
{
LabelText = LoginPanelStrings.RememberUsername,
Current = config.GetBindable<bool>(OsuSetting.SaveUsername),
@ -131,7 +130,6 @@ namespace osu.Game.Overlays.Login
forgottenPasswordLink.AddLink(LayoutStrings.PopupLoginLoginForgot, $"{api.WebsiteRootUrl}/home/password-reset");
password.OnCommit += (_, _) => performLogin();
rememberUsername.SettingChanged += () => onRememberUsernameChanged(config);
if (api.LastLoginError?.Message is string error)
{
@ -148,12 +146,6 @@ namespace osu.Game.Overlays.Login
shakeSignIn.Shake();
}
private void onRememberUsernameChanged(OsuConfigManager config)
{
if (rememberUsername.Current.Value == false)
config.SetValue(OsuSetting.Username, string.Empty);
}
protected override bool OnClick(ClickEvent e) => true;
protected override void OnFocus(FocusEvent e)