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 {
app: { payload: { app, relatedVideos = [] } },
'device-list': deviceList
} = data
const hasRelatedVideos = relatedVideos.length > 0
// console.log('deviceList', deviceList)
// console.log('video.payload', Object.keys(video.payload))
@ -110,6 +112,9 @@ export class AppTemplate {
const relatedLinksHtml = renderPageLinksHtml( app.relatedLinks )
const relatedVideosRowHtml = hasRelatedVideos ? await this.boundComponent(VideoRow)( relatedVideos ) : null
return /* html */`
<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">
@ -151,7 +156,7 @@ export class AppTemplate {
</div>
</div>
${ relatedVideos.length > 0 ? /* html */`
${ hasRelatedVideos ? /* html */`
<div
class="related-videos w-full"
>
@ -159,7 +164,7 @@ export class AppTemplate {
Related Videos
</h2>
${ this.boundComponent(VideoRow)( relatedVideos ) }
${ relatedVideosRowHtml }
</div>
` : '' }