From 587dac99c5964aa2451fd0ed382c8f2b6afa818e Mon Sep 17 00:00:00 2001 From: grey Date: Fri, 7 Jul 2023 15:43:02 +0200 Subject: [PATCH] - fixed visual error where empty entries where shown as null --- src/routes/frontend/manage/categoryManager.ts | 6 ++++++ static/js/confettiHeader.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/routes/frontend/manage/categoryManager.ts b/src/routes/frontend/manage/categoryManager.ts index 9a53069..c3646dc 100644 --- a/src/routes/frontend/manage/categoryManager.ts +++ b/src/routes/frontend/manage/categoryManager.ts @@ -7,6 +7,12 @@ function get(req: Request, res: Response) { .findMany({}) .then((items) => { // Count amount of total items + // Replace "null" with an empty string + items.forEach((item) => { + if (item.description == null || item.description == "null") { + item.description = ''; + } + }); res.render(__path + '/src/frontend/manage/categoryManager.eta.html', { items: items }); }) .catch((err) => { diff --git a/static/js/confettiHeader.js b/static/js/confettiHeader.js index b812958..091f065 100644 --- a/static/js/confettiHeader.js +++ b/static/js/confettiHeader.js @@ -4,9 +4,9 @@ function randomInRange(min, max) { function doTheConfetti() { confetti({ - angle: 100, + angle: randomInRange(90, 110), spread: randomInRange(70, 120), particleCount: randomInRange(100, 200), - origin: { y: 0.6 } + origin: { y: 0.6, x: randomInRange(0.4, 0.8) }, }); }