From 42d767b443d93147e50484762a1d09a0f8f0659d Mon Sep 17 00:00:00 2001 From: pigalot Date: Tue, 11 Jan 2022 23:46:25 +0000 Subject: [PATCH] Fix Bug with smart supply leftovers --- src/Corporation/ui/SmartSupplyModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 + "");