Fix app related videos not rendering

This commit is contained in:
Sam Carlton 2021-05-08 15:49:13 -05:00
parent 0cbe9b33d5
commit f576c72451

View file

@ -86,13 +86,15 @@ export class AppTemplate {
} }
} }
render( data ) { async render( data ) {
const { const {
app: { payload: { app, relatedVideos = [] } }, app: { payload: { app, relatedVideos = [] } },
'device-list': deviceList 'device-list': deviceList
} = data } = data
const hasRelatedVideos = relatedVideos.length > 0
// console.log('deviceList', deviceList) // console.log('deviceList', deviceList)
// console.log('video.payload', Object.keys(video.payload)) // console.log('video.payload', Object.keys(video.payload))
@ -110,6 +112,9 @@ export class AppTemplate {
const relatedLinksHtml = renderPageLinksHtml( app.relatedLinks ) const relatedLinksHtml = renderPageLinksHtml( app.relatedLinks )
const relatedVideosRowHtml = hasRelatedVideos ? await this.boundComponent(VideoRow)( relatedVideos ) : null
return /* html */` return /* html */`
<section class="container py-32"> <section class="container py-32">
<div class="intro-content flex flex-col items-center text-center min-h-3/4-screen md:min-h-0 space-y-8"> <div class="intro-content flex flex-col items-center text-center min-h-3/4-screen md:min-h-0 space-y-8">
@ -151,7 +156,7 @@ export class AppTemplate {
</div> </div>
</div> </div>
${ relatedVideos.length > 0 ? /* html */` ${ hasRelatedVideos ? /* html */`
<div <div
class="related-videos w-full" class="related-videos w-full"
> >
@ -159,7 +164,7 @@ export class AppTemplate {
Related Videos Related Videos
</h2> </h2>
${ this.boundComponent(VideoRow)( relatedVideos ) } ${ relatedVideosRowHtml }
</div> </div>
` : '' } ` : '' }