Implement DeletedChildsPlaceholder component

This commit is contained in:
Andrei Zavatski
2019-10-09 13:37:07 +03:00
parent b2bd78308d
commit 7e3c97f496
3 changed files with 86 additions and 4 deletions

View File

@ -5,6 +5,7 @@ using Newtonsoft.Json;
using osu.Game.Users;
using System;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Online.API.Requests.Responses
{
@ -91,5 +92,22 @@ namespace osu.Game.Online.API.Requests.Responses
{
return IsDeleted ? @"deleted" : MessageHTML.Replace("<div class='osu-md-default'>", "").Replace("<p class=\"osu-md-default__paragraph\">", "").Replace("<br />", "").Replace("</p>", "").Replace("</div>", "").Replace("&quot;", "\"");
}
public int GetDeletedChildsCount()
{
int count = 0;
if (ChildComments.Any())
ChildComments.ForEach(child =>
{
if (child.IsDeleted)
count++;
});
if (IsDeleted)
count++;
return count;
}
}
}