Prevent empty transfer names

This commit is contained in:
Emilia Allison 2023-06-08 10:59:47 -04:00
parent 768b88a562
commit e2f28f818b
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 1 additions and 0 deletions

View File

@ -25,6 +25,7 @@ pub fn TransferMenu() -> Html {
let target: Option<EventTarget> = e.target(); let target: Option<EventTarget> = e.target();
let input = target.and_then(|t| t.dyn_into::<HtmlInputElement>().ok()); let input = target.and_then(|t| t.dyn_into::<HtmlInputElement>().ok());
if let Some(input) = input { if let Some(input) = input {
if input.value() == "" {return ()} // We do not want empty inputs!
ct_dispatch.reduce_mut(|state| { ct_dispatch.reduce_mut(|state| {
state.transfer.name = input.value().clone(); state.transfer.name = input.value().clone();
}); });