From 2b3b7be711af9d6d6d5e605362d6d561e9864ca1 Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Fri, 20 Sep 2024 10:33:17 +0200 Subject: [PATCH] hotfix(renderSoMe): check if soMeLinkArray exists --- src/components/navigation/footer/Footer.tsx | 1 + studio/lib/interfaces/socialMedia.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/navigation/footer/Footer.tsx b/src/components/navigation/footer/Footer.tsx index e9fc2efaf..106ed863b 100644 --- a/src/components/navigation/footer/Footer.tsx +++ b/src/components/navigation/footer/Footer.tsx @@ -92,6 +92,7 @@ const renderSoMe = (data: Navigation, soMeData: SocialMediaProfiles) => { const socialMediaSections = filterSectionsByType(data, "socialMedia"); return ( socialMediaSections && + soMeData.soMeLinkArray && renderList( soMeData.soMeLinkArray.map((link: SocialMediaLink) => (
  • diff --git a/studio/lib/interfaces/socialMedia.ts b/studio/lib/interfaces/socialMedia.ts index 916829806..77a96a2f6 100644 --- a/studio/lib/interfaces/socialMedia.ts +++ b/studio/lib/interfaces/socialMedia.ts @@ -12,5 +12,5 @@ export interface SocialMediaLink { export interface SocialMediaProfiles { _id: string; _type: typeof soMeLinksID; - soMeLinkArray: SocialMediaLink[]; + soMeLinkArray?: SocialMediaLink[]; }