Fix Bug with smart supply leftovers

This commit is contained in:
pigalot 2022-01-11 23:46:25 +00:00
parent 74019bc2be
commit 42d767b443

@ -20,7 +20,8 @@ function Leftover(props: ILeftoverProps): React.ReactElement {
function onChange(event: React.ChangeEvent<HTMLInputElement>): void { function onChange(event: React.ChangeEvent<HTMLInputElement>): void {
try { 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); SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked);
} catch (err) { } catch (err) {
dialogBoxCreate(err + ""); dialogBoxCreate(err + "");