fix: Volume not saved on new transfer creation

This commit is contained in:
Emilia Allison 2024-08-09 21:01:50 -04:00
parent 2ccb84041b
commit e829a49424
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 4 additions and 1 deletions

View File

@ -184,12 +184,15 @@ pub fn save_transfer_button_callback_callback(
.iter() .iter()
.find(|dpi| dpi.get_uuid() == main_state.selected_dest_plate) .find(|dpi| dpi.get_uuid() == main_state.selected_dest_plate)
{ {
let new_transfer = Transfer::new( // Only mutable for volume assignment!
let mut new_transfer = Transfer::new(
spi.clone(), spi.clone(),
dpi.clone(), dpi.clone(),
ct_state.transfer.transfer_region.clone(), ct_state.transfer.transfer_region.clone(),
ct_state.transfer.name.clone(), ct_state.transfer.name.clone(),
); );
new_transfer.volume = ct_state.transfer.volume;
main_dispatch.reduce_mut(|state| { main_dispatch.reduce_mut(|state| {
state.transfers.push(new_transfer); state.transfers.push(new_transfer);
state.selected_transfer = state state.selected_transfer = state