1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 10:33:07 +08:00

Use nullable long type for id value

This commit is contained in:
Andrei Zavatski 2020-01-07 12:29:21 +03:00
parent fa0d9f8e9d
commit 6adf5ba381

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Comments
public class CommentsContainer : CompositeDrawable
{
private CommentableType type;
private long id;
private long? id;
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
public readonly BindableBool ShowDeleted = new BindableBool();
@ -134,18 +134,18 @@ namespace osu.Game.Overlays.Comments
private void resetComments()
{
if (id == default)
return;
clearComments();
getComments();
}
private void getComments()
{
if (!id.HasValue)
return;
request?.Cancel();
loadCancellation?.Cancel();
request = new GetCommentsRequest(type, id, Sort.Value, currentPage++);
request = new GetCommentsRequest(type, id.Value, Sort.Value, currentPage++);
request.Success += onSuccess;
api.Queue(request);
}