mirror of https://github.com/ppy/osu
Removed a useless branch in the statistics request
This commit is contained in:
parent
bc1b20291b
commit
80fa90f65d
|
@ -71,7 +71,7 @@ private void load(IAPIProvider provider, OsuConfigManager config)
|
|||
activity.BindTo(u.NewValue.Activity);
|
||||
}, true);
|
||||
|
||||
ruleset.BindValueChanged(_ => requestUserRulesetsRankings());
|
||||
ruleset.BindValueChanged(_ => updateStatus());
|
||||
status.BindValueChanged(_ => updateStatus());
|
||||
activity.BindValueChanged(_ => updateStatus());
|
||||
privacyMode.BindValueChanged(_ => updateStatus());
|
||||
|
@ -129,9 +129,6 @@ private void requestUserRulesetsRankings()
|
|||
{
|
||||
RulesetInfo cachedRuleset = ruleset.Value;
|
||||
|
||||
// When first logging in, we can't send a request with an empty id
|
||||
if (api.LocalUser.Value.Id > 1)
|
||||
{
|
||||
var req = new GetUsersRequest(new int[] { api.LocalUser.Value.Id });
|
||||
req.Success += result =>
|
||||
{
|
||||
|
@ -147,24 +144,6 @@ private void requestUserRulesetsRankings()
|
|||
|
||||
api.Queue(req);
|
||||
}
|
||||
else
|
||||
{
|
||||
var req = new GetUserRequest(api.LocalUser.Value.Username, ruleset.Value);
|
||||
|
||||
req.Success += result =>
|
||||
{
|
||||
user.Value.RulesetsStatistics ??= new Dictionary<string, UserStatistics>();
|
||||
user.Value.RulesetsStatistics[ruleset.Value.ShortName] = result.Statistics;
|
||||
updateStatus();
|
||||
};
|
||||
req.Failure += error =>
|
||||
{
|
||||
updateStatus();
|
||||
};
|
||||
|
||||
api.Queue(req);
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly int ellipsis_length = Encoding.UTF8.GetByteCount(new[] { '…' });
|
||||
|
||||
|
|
Loading…
Reference in New Issue