Prevent empty transfer names
This commit is contained in:
parent
768b88a562
commit
e2f28f818b
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue