diff --git a/src/Corporation/ui/SmartSupplyModal.tsx b/src/Corporation/ui/SmartSupplyModal.tsx index d853ec2f7..b4c031d99 100644 --- a/src/Corporation/ui/SmartSupplyModal.tsx +++ b/src/Corporation/ui/SmartSupplyModal.tsx @@ -20,7 +20,8 @@ function Leftover(props: ILeftoverProps): React.ReactElement { function onChange(event: React.ChangeEvent): void { try { - const material = props.warehouse.materials[props.matName]; + const matName = props.matName.replace(/ /g, ""); + const material = props.warehouse.materials[matName]; SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked); } catch (err) { dialogBoxCreate(err + "");