Remove unused rooms before trying to create

Prevent the strange situation where trying to create tells you the room already exists, and when you try to join, the error is that the room doesn't exist
master
Daniel Berteaud 11 years ago
parent 610ff99f2c
commit e06811c8d3
  1. 1
      public/vroom.pl

@ -243,6 +243,7 @@ post '/create' => sub {
$self->stash(msg => $self->l('ERROR_NAME_INVALID')); $self->stash(msg => $self->l('ERROR_NAME_INVALID'));
return $self->render('error'); return $self->render('error');
} }
$self->delete_rooms;
if ($self->create_room($name,$self->session('name'))){ if ($self->create_room($name,$self->session('name'))){
$self->redirect_to('/'.$name); $self->redirect_to('/'.$name);
} }

Loading…
Cancel
Save