End time as error msg
This commit is contained in:
parent
cadb5f7af8
commit
f5f768f728
1 changed files with 14 additions and 0 deletions
14
src/App.vue
14
src/App.vue
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue