Fix beeldscherm by resolving null to marietje

This commit is contained in:
2023-10-11 17:22:04 +02:00
committed by Lars van Rhijn
parent a9e0614b2c
commit 04bf9532e4

View File

@ -59,7 +59,13 @@
return response.json(); return response.json();
}) })
.then(json => { .then(json => {
updateScreen(json.current_song.user.name, json.current_song.song.artist, json.current_song.song.title); let requestor;
if(json.current_song.user === null) {
requestor = "Marietje";
} else {
requestor = json.current_song.user.name;
}
updateScreen(requestor, json.current_song.song.artist, json.current_song.song.title);
setTimeout(fetchCurrentQueue, 1000); setTimeout(fetchCurrentQueue, 1000);
}).catch(err => { }).catch(err => {
if(err.name == "NotLoggedIn") { if(err.name == "NotLoggedIn") {