Fix not being able to close nick dialog

This commit is contained in:
Joscha 2022-07-23 23:45:01 +02:00
parent 77c5b479aa
commit 73cb568702
4 changed files with 39 additions and 22 deletions

View file

@ -237,11 +237,18 @@ impl Rooms {
}
_ => {}
},
State::ShowRoom(_) if event.code == KeyCode::Esc => self.state = State::ShowList,
State::ShowRoom(name) => {
self.get_or_insert_room(name.clone())
if self
.get_or_insert_room(name.clone())
.handle_key_event(terminal, crossterm_lock, event)
.await
{
return;
}
if event.code == KeyCode::Esc {
self.state = State::ShowList;
}
}
State::Connect(ed) => match event.code {
KeyCode::Esc => self.state = State::ShowList,