From 1f0c62176aa8136ff9821210fd4255847d527477 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 8 Sep 2021 20:54:38 +0400 Subject: [PATCH] Another small refactoring. Why have I done that in the first place?... --- homepage/index.js | 1 - homepage/views/guestbook.pug | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/homepage/index.js b/homepage/index.js index 77e01ef..291d41f 100644 --- a/homepage/index.js +++ b/homepage/index.js @@ -106,7 +106,6 @@ function setRoutes() { tz: util.getClientTimezone(ctx), owner: config.guestbook.owner, posts: posts, - error: posts === null, pages_count: Math.ceil(await guestbook.getPostsCount() / page_size) }); }) .post('/guestbook', bodyParser, async ctx => { diff --git a/homepage/views/guestbook.pug b/homepage/views/guestbook.pug index 8021524..1954d9b 100644 --- a/homepage/views/guestbook.pug +++ b/homepage/views/guestbook.pug @@ -41,7 +41,7 @@ block content each line in post.feedback.split("\n") p= line else - if (error) + if (posts === null) p.center Cannot establish database connection. else p.center No posts.