From 2fbd5d0f1c6f9deb0ffa12e32e390fd4d7b5d07e Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Thu, 9 Jun 2022 14:49:59 -0500 Subject: [PATCH] Show related apps on video listings --- helpers/listing-page.js | 4 ++-- src/components/video-listing.astro | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/helpers/listing-page.js b/helpers/listing-page.js index 73f0c7c..bb47392 100644 --- a/helpers/listing-page.js +++ b/helpers/listing-page.js @@ -128,7 +128,7 @@ export class ListingDetails { } get hasRelatedApps () { - return false + return Array.isArray( this.api.appLinks ) && this.api.appLinks.length > 0 } get hasBenchmarksPage () { @@ -143,7 +143,7 @@ export class ListingDetails { get initialVideo () { if ( this.type === 'video' ) { - return this.api.video + return this.api } if ( this.hasRelatedVideos ) { diff --git a/src/components/video-listing.astro b/src/components/video-listing.astro index a84b5c0..e20c158 100644 --- a/src/components/video-listing.astro +++ b/src/components/video-listing.astro @@ -53,7 +53,22 @@ const details = ensureListingDetails( listing )
{ details.hasRelatedApps && -
{ "featuredAppsHtml/related apps" }
+ }