diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/index.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/static/index.js b/static/index.js index c753e3f..275e68b 100644 --- a/static/index.js +++ b/static/index.js @@ -2,6 +2,7 @@ const titleBar = document.getElementById("title") const buttonDetails = document.getElementById("toggle-details") const divDetails = document.getElementById("details") +const divTags = document.getElementById("details-tags") const buttonComments = document.getElementById("toggle-comments") const divComments = document.getElementById("comments") const commentTemplate = document.getElementById("template-comment") @@ -108,14 +109,16 @@ async function toggleDetails() { if (detailsLoaded) return toggleVis(divDetails) - // data const data = await getApiReq(`/details?id=${player.playerInfo.videoData.video_id}`) // pop const fieldElements = fillFields(data, divDetails) fieldElements.author.href = `https://www.youtube.com/channel/${data.channel}` - fieldElements.tags.textContent = data.tags.join(", ") + if (data.tags) + fieldElements.tags.textContent = data.tags.join(", ") + else + divTags.remove() // done detailsLoaded = true |
