Prevent error on upper case region entry

This commit is contained in:
Emilia Allison 2023-06-08 11:00:14 -04:00
parent e2f28f818b
commit 43f17f0d6a
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ pub fn TransferMenu() -> Html {
let target: Option<EventTarget> = e.target();
let input = target.and_then(|t| t.dyn_into::<HtmlInputElement>().ok());
if let Some(input) = input {
if let Ok(rd) = RegionDisplay::try_from(input.value()) {
if let Ok(rd) = RegionDisplay::try_from(input.value().to_uppercase()) {
ct_dispatch.reduce_mut(|state| {
state.transfer.transfer_region.source_region = Region::from(&rd);
});
@ -58,7 +58,7 @@ pub fn TransferMenu() -> Html {
let target: Option<EventTarget> = e.target();
let input = target.and_then(|t| t.dyn_into::<HtmlInputElement>().ok());
if let Some(input) = input {
if let Ok(rd) = RegionDisplay::try_from(input.value()) {
if let Ok(rd) = RegionDisplay::try_from(input.value().to_uppercase()) {
ct_dispatch.reduce_mut(|state| {
state.transfer.transfer_region.dest_region = Region::from(&rd);
});