1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Add IsDeleted property

This commit is contained in:
Andrei Zavatski 2019-10-07 18:45:22 +03:00
parent aa8df0fa20
commit cc6bf2f173
2 changed files with 17 additions and 5 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests.Responses
set
{
parentId = value;
IsTopLevel = value != null;
IsTopLevel = value == null;
}
}
@ -54,8 +54,18 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"updated_at")]
public DateTimeOffset? UpdatedAt { get; set; }
private DateTimeOffset? deletedAt;
[JsonProperty(@"deleted_at")]
public DateTimeOffset? DeletedAt { get; set; }
public DateTimeOffset? DeletedAt
{
get => deletedAt;
set
{
deletedAt = value;
IsDeleted = value != null;
}
}
[JsonProperty(@"edited_at")]
public DateTimeOffset? EditedAt { get; set; }
@ -64,5 +74,7 @@ namespace osu.Game.Online.API.Requests.Responses
public long? EditedById { get; set; }
public bool IsTopLevel { get; set; }
public bool IsDeleted { get; set; }
}
}

View File

@ -30,7 +30,6 @@ namespace osu.Game.Overlays
private GetCommentsRequest request;
private readonly CommentsHeader header;
private readonly Box background;
private readonly FillFlowContainer content;
@ -54,7 +53,7 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
header = new CommentsHeader
new CommentsHeader
{
Sort = { BindTarget = Sort }
},
@ -91,7 +90,8 @@ namespace osu.Game.Overlays
foreach (var c in response.Comments)
{
createDrawableComment(c);
if (!c.IsDeleted)
createDrawableComment(c);
}
}