Stop sending empty messages

Former-commit-id: 0f2ed6d0adbbf07566ae1cee1cb0c0498c0c15d8
This commit is contained in:
Imbris 2019-04-20 10:40:48 -04:00
parent 3cc0cf8443
commit 2147774665

View File

@ -154,13 +154,13 @@ impl Chat {
}
}
// If enter is pressed send the current message
// If enter is pressed and the input box is not empty send the current message
if ui_widgets
.widget_input(self.ids.input)
.presses()
.key()
.any(|key_press| match key_press.key {
Key::Return => true,
Key::Return if !self.input.is_empty() => true,
_ => false,
})
{