1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:03:13 +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 public class CommentsContainer : CompositeDrawable
{ {
private CommentableType type; private CommentableType type;
private long id; private long? id;
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>(); public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
public readonly BindableBool ShowDeleted = new BindableBool(); public readonly BindableBool ShowDeleted = new BindableBool();
@ -134,18 +134,18 @@ namespace osu.Game.Overlays.Comments
private void resetComments() private void resetComments()
{ {
if (id == default)
return;
clearComments(); clearComments();
getComments(); getComments();
} }
private void getComments() private void getComments()
{ {
if (!id.HasValue)
return;
request?.Cancel(); request?.Cancel();
loadCancellation?.Cancel(); loadCancellation?.Cancel();
request = new GetCommentsRequest(type, id, Sort.Value, currentPage++); request = new GetCommentsRequest(type, id.Value, Sort.Value, currentPage++);
request.Success += onSuccess; request.Success += onSuccess;
api.Queue(request); api.Queue(request);
} }