1
0

Check if tbody is present and create it if doesn't.

This commit is contained in:
Alexander Andreev 2023-03-12 21:57:03 +04:00
parent 6b1f2e76e3
commit 341ea73e97
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -24,6 +24,9 @@ function updateLastPlayedSong() {
if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText) if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText)
return; return;
if ($('last-played').firstChild === null)
$('last-played').appendChild(document.createElement("tbody"))
if ($('last-played').firstChild.children.length == 10) if ($('last-played').firstChild.children.length == 10)
$('last-played').firstChild.firstChild.remove(); $('last-played').firstChild.firstChild.remove();