From 6dff05818b47c873246dc55250ed3188920c4d1c Mon Sep 17 00:00:00 2001 From: limited_dev Date: Mon, 13 Feb 2023 21:39:39 +0100 Subject: [PATCH] fix: users can now be unbanned. --- .../Shared/Components/Forms/CommentForm.razor | 5 +++++ ImageBoardServerApp/Shared/Components/Forms/PostForm.razor | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor index fd66fbd..34f7c16 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/CommentForm.razor @@ -83,6 +83,11 @@ return; } int userID = foundusr.UserID; + if (DateTimeOffset.Now.ToUnixTimeMilliseconds() - foundusr.TimeBanned < 0) + { + foundusr.TimeBanned = -1; + } + if (foundusr.TimeBanned != -1) { hasErr = true; diff --git a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor index a46475c..0c7b999 100644 --- a/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor +++ b/ImageBoardServerApp/Shared/Components/Forms/PostForm.razor @@ -98,6 +98,11 @@ return; } int userID = foundusr.UserID; + if (DateTimeOffset.Now.ToUnixTimeMilliseconds() - foundusr.TimeBanned < 0) + { + foundusr.TimeBanned = -1; + } + if (foundusr.TimeBanned != -1) { hasErr = true;