End time as error msg

This commit is contained in:
Christoph Stahl 2023-05-23 09:08:32 +02:00
parent cadb5f7af8
commit f5f768f728

View file

@ -196,6 +196,20 @@ function registerSocketEvents() {
state.value.last_msg = response.msg
$("#msg").foundation("open")
})
state.socket.on("err", (response) => {
switch(response.type) {
"QUEUE_FULL":
var prefix = "The song queue is full and ends at ";
date = new Date(response.end_time * 1000).toLocaleTimeString;
state.value.last_msg = prefix + date;
break;
default:
state.value.last_msg = "Unknown Error";
break;
}
$("#msg").foundation("open")
})
}
function joinRoom() {