finished Board Locking

This commit is contained in:
limited_dev 2023-03-04 23:09:26 +01:00
parent 97e4b0026b
commit 6e9be8c931
2 changed files with 18 additions and 1 deletions

View file

@ -106,6 +106,14 @@
return; return;
} }
BoardData b = await BoardsRepository.getBoardByTagAsync(post.Board);
if (b.isLocked)
{
hasErr = true;
postErr = "This board is currently locked.";
return;
}
bool hasImage = selectedFile != null; bool hasImage = selectedFile != null;
if (postUsername == null || postUsername == "") if (postUsername == null || postUsername == "")
{ {

View file

@ -29,7 +29,7 @@
</div> </div>
<div class="pd centered marg"> <div class="pd centered marg">
<RadzenTextBox Placeholder="Title" MaxLength="20" @bind-Value="@postTitle" Class="w-100"/> <RadzenTextBox Placeholder="Title" MaxLength="40" @bind-Value="@postTitle" Class="w-100"/>
</div> </div>
<div class="pd centered marg"> <div class="pd centered marg">
@ -110,6 +110,15 @@
//Maybe redirect to /banned? //Maybe redirect to /banned?
return; return;
} }
BoardData b = await BoardsRepository.getBoardByTagAsync(board.Tag);
if (b.isLocked)
{
hasErr = true;
postErr = "This board is currently locked.";
return;
}
foundusr.lastActionTimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(); foundusr.lastActionTimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
await UsersRepository.updateUserAsync(foundusr); await UsersRepository.updateUserAsync(foundusr);