From 609866b6ad3de19549044913b7173e2e5a7e9c68 Mon Sep 17 00:00:00 2001 From: roxwize Date: Thu, 30 Jan 2025 23:21:57 -0500 Subject: [PATCH] hotfixes 2 Signed-off-by: roxwize --- routes/updates.ts | 8 ++++---- routes/users.ts | 2 +- static/css/main.css | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/routes/updates.ts b/routes/updates.ts index 0a2be3c..ae37912 100644 --- a/routes/updates.ts +++ b/routes/updates.ts @@ -214,10 +214,6 @@ export default async function (app: Express, db: NodePgDatabase) { .leftJoin(users, eq(journalEntries.user, users.id)) )[0]; - //? put into util function? - //? also GOD - entry.moodString = journalMoodString(entry.moodChange); - const isMod = req.session["status"] & UserStatus.MODERATOR; if ( !entry || @@ -229,6 +225,10 @@ export default async function (app: Express, db: NodePgDatabase) { return; } + //? put into util function? + //? also GOD + entry.moodString = journalMoodString(entry.moodChange); + // maybe turn ([x] !== req.session["user"] && !(req.session["status"] & UserStatus.MODERATOR)) into util function entry.content = entry.visibility === 2 && diff --git a/routes/users.ts b/routes/users.ts index f582481..2303304 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -181,7 +181,7 @@ export default async function (app: Express, db: NodePgDatabase) { return; } } else { - if (!validateUrl(req.body.website)) { + if (req.body.website?.length > 0 && !validateUrl(req.body.website)) { req.flash( "error", "The website URL provided is invalid or malformed." diff --git a/static/css/main.css b/static/css/main.css index 0ff799e..154b5ee 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -170,6 +170,7 @@ input { color: black; font-family: inherit; font-size: 14px; + font-weight: normal; } button:focus, textarea:focus,