Fix error handling for lock/unlock

master
Daniel Berteaud 11 years ago
parent dec8da6a44
commit 96d8a0eaa6
  1. 8
      public/js/vroom.js
  2. 3
      public/vroom.pl

@ -580,10 +580,10 @@ function initVroom(room) {
room: roomName
},
error: function(data) {
var msg = (data && data.msg) ? data.msg : locale.ERROR_OCCURED;
$.notify(msg, 'error');
$.notify(locale.ERROR_OCCURED, 'error');
},
success: function(data) {
if (data.status == 'success'){
$.notify(data.msg, 'info');
if (action === 'lock'){
$("#lockLabel").addClass('btn-danger');
@ -594,6 +594,10 @@ function initVroom(room) {
webrtc.sendToAll('room_unlocked', {});
}
}
else{
$.notify(data.msg, 'error');
}
}
});
});

@ -518,13 +518,14 @@ post '/action' => sub {
return $self->render(
json => {
msg => $self->l('ERROR_OCCURED'),
status => 'error'
},
status => '500'
);
}
return $self->render(
json => {
msg => $success,
status => 'success'
}
);
}

Loading…
Cancel
Save