1
Fork 0

Don't insert ListenBrainz element if no listens are available.

This commit is contained in:
Bauke 2021-11-27 13:05:52 +01:00
parent 203e37c35f
commit a03db59c65
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@ window.addEventListener('DOMContentLoaded', async () => {
}
const data = await result.json();
if (data.payload.listens.length === 0) {
return;
}
const listen = data.payload.listens[0];
const listenHtml = `<div class="divider"></div><div class="listenbrainz">
<a href="https://listenbrainz.org/user/BaukeXYZ/" target="_blank">