1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Revert failed user requests changes with returning user ID instead

This commit is contained in:
Salman Ahmed 2021-02-17 11:21:33 +03:00
parent 85ebc8e06c
commit 61bf9a64bb
2 changed files with 8 additions and 3 deletions

View File

@ -277,8 +277,7 @@ namespace osu.Game.Tournament.Screens.Editors
userId.Value = user.Id.ToString();
userId.BindValueChanged(idString =>
{
if (!(int.TryParse(idString.NewValue, out var parsed)))
return;
int.TryParse(idString.NewValue, out var parsed);
user.Id = parsed;

View File

@ -217,6 +217,8 @@ namespace osu.Game.Tournament
req.Success += res =>
{
user.Id = res.Id;
user.Username = res.Username;
user.Statistics = res.Statistics;
user.Country = res.Country;
@ -225,7 +227,11 @@ namespace osu.Game.Tournament
success?.Invoke();
};
req.Failure += _ => failure?.Invoke();
req.Failure += _ =>
{
user.Id = 1;
failure?.Invoke();
};
if (immediate)
API.Perform(req);