fix: Selecting a plate resets both regions

Old behaviour only reset one, I don't think
this is the intuitively expect behaviour;
easy to change back if we want this instead.
This commit is contained in:
Emilia Allison 2023-06-05 14:31:50 -04:00
parent 52baa03d79
commit 5153b67fe4
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,7 @@ pub fn Tree(props: &TreeProps) -> Html {
if let Ok(id) = u128::from_str_radix(li.id().as_str(), 10) {
ct_dispatch.reduce_mut(|state| {
state.transfer.transfer_region.source_region = Region::default();
state.transfer.transfer_region.dest_region = Region::default();
});
main_dispatch.reduce_mut(|state| {
state.selected_source_plate = Uuid::from_u128(id);
@ -80,6 +81,7 @@ pub fn Tree(props: &TreeProps) -> Html {
if let Some(li) = li {
if let Ok(id) = u128::from_str_radix(li.id().as_str(), 10) {
ct_dispatch.reduce_mut(|state| {
state.transfer.transfer_region.source_region = Region::default();
state.transfer.transfer_region.dest_region = Region::default();
});
main_dispatch.reduce_mut(|state| {