1
0
mirror of https://github.com/dani/vroom.git synced 2024-06-01 21:11:41 +02:00

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
This commit is contained in:
Daniel Berteaud 2014-05-06 22:05:59 +02:00
parent 610ff99f2c
commit e06811c8d3

View File

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