Add ability to hide comments on levels and profiles

This commit is contained in:
jvyden 2022-08-06 14:23:37 -04:00
parent 0b8c0cbfb4
commit 8fe9bd4c57
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
12 changed files with 123 additions and 16 deletions

View file

@ -13,7 +13,7 @@ public class UserPage : BaseLayout
{
public List<Comment>? Comments;
public bool CommentsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.ProfileCommentsEnabled;
public bool CommentsEnabled;
public bool IsProfileUserHearted;
@ -51,7 +51,9 @@ public class UserPage : BaseLayout
}
this.Photos = await this.Database.Photos.Include(p => p.Slot).OrderByDescending(p => p.Timestamp).Where(p => p.CreatorId == userId).Take(6).ToListAsync();
if (this.CommentsEnabled)
this.CommentsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled && this.ProfileUser.CommentsEnabled;
if(this.CommentsEnabled)
{
this.Comments = await this.Database.Comments.Include(p => p.Poster)
.OrderByDescending(p => p.Timestamp)