From 6190243be8980dbdfd55f9bedbc097a40ff8cd91 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 11 Nov 2023 15:09:18 +0200 Subject: [PATCH] Fix voting page crash continued --- .../plus-voting/routes/plus.voting.results.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/features/plus-voting/routes/plus.voting.results.tsx b/app/features/plus-voting/routes/plus.voting.results.tsx index f1c7b6586..4fc32796f 100644 --- a/app/features/plus-voting/routes/plus.voting.results.tsx +++ b/app/features/plus-voting/routes/plus.voting.results.tsx @@ -21,14 +21,18 @@ export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: styles }]; }; -export const meta: V2_MetaFunction = () => { - const { month, year } = lastCompletedVoting(new Date()); +export const meta: V2_MetaFunction = (args) => { + const data = args.data as SerializeFrom; + + if (!data) return []; return [ { title: makeTitle("Plus Server voting history") }, { name: "description", - content: `Plus Server voting results for ${month + 1}/${year}`, + content: `Plus Server voting results for ${ + data.lastCompletedVoting.month + 1 + }/${data.lastCompletedVoting.year}`, }, ]; };