From 02b087a38ea5317440b710eae0be57f9755d5a06 Mon Sep 17 00:00:00 2001 From: swag Date: Tue, 11 Jan 2022 20:15:53 -0500 Subject: [PATCH] Fix post count --- guestbook-ng.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guestbook-ng.pl b/guestbook-ng.pl index a70a387..a6797d2 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -39,6 +39,8 @@ under sub ($c) { $c->stash(status => 403) if $c->flash('error'); + $c->stash(post_count => format_number $c->message->get_post_count); + 1; }; @@ -46,13 +48,11 @@ get '/' => sub ($c) { my $this_page = $c->param('page') || 1; my $last_page = $c->message->get_last_page(); my $view_posts = $c->message->get_posts($this_page); - my $post_count = format_number $c->message->get_post_count(); $c->stash( view_posts => $view_posts, this_page => $this_page, - last_page => $last_page, - post_count => $post_count + last_page => $last_page ); $c->render();