1
0

Do not remove first row while there is less than 10 rows.

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

View File

@ -24,7 +24,8 @@ function updateLastPlayedSong() {
if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText) if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText)
return; return;
$('last-played').firstChild.firstChild.remove(); if ($('last-played').firstChild.children.length == 10)
$('last-played').firstChild.firstChild.remove();
let row = $('last-played').insertRow(); let row = $('last-played').insertRow();
row.insertCell().appendChild(document.createTextNode(last_played.time)); row.insertCell().appendChild(document.createTextNode(last_played.time));