From 9dc2149f343ff05bc85fd0322ea3be7e722ddca1 Mon Sep 17 00:00:00 2001 From: Marco Acierno Date: Sat, 20 Jun 2026 21:35:29 +0200 Subject: [PATCH] Handle missing footer menu better --- frontend/src/components/footer/index.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/footer/index.tsx b/frontend/src/components/footer/index.tsx index ea2b315123..0862d9c6a3 100644 --- a/frontend/src/components/footer/index.tsx +++ b/frontend/src/components/footer/index.tsx @@ -3,7 +3,6 @@ import { Heading, Text, } from "@python-italia/pycon-styleguide"; -import React, { useState } from "react"; import { FormattedMessage } from "react-intl"; import { useRouter } from "next/router"; @@ -29,21 +28,16 @@ export const Footer = () => { setModal("newsletter"); }; - const { - conference: { footerEn, footerIt }, - } = data || { - conference: { - footerEn: { links: [] }, - footerIt: { links: [] }, - }, - }; + const conference = data?.conference; + const footerEn = conference?.footerEn; + const footerIt = conference?.footerIt; const menu: { links: { text: string; link: string; }[]; - } = language === "en" ? footerEn : footerIt; + } = (language === "en" ? footerEn : footerIt) ?? { links: [] }; return ( <>