diff --git a/helpers/listing-page.js b/helpers/listing-page.js index 982f1a1..c04f6ff 100644 --- a/helpers/listing-page.js +++ b/helpers/listing-page.js @@ -128,8 +128,20 @@ export class ListingDetails { return makeApiPathFromEndpoint( this.api.endpoint ) } + get relatedVideos () { + if ( Array.isArray( this.api.relatedVideos ) ) { + return this.api.relatedVideos + } + + if ( !!this.api.payload && Array.isArray( this.api.payload.relatedVideos ) ) { + return this.api.payload.relatedVideos + } + + return [] + } + get hasRelatedVideos () { - return Array.isArray( this.api.relatedVideos ) && this.api.relatedVideos.length > 0 + return this.relatedVideos.length > 0 } get hasRelatedApps () {