Don't hide irrelevant materials if their stock is not empty

This commit is contained in:
SagePtr 2022-01-29 18:58:21 +02:00
parent 9ddb1c4379
commit a5f82e96ed

@ -83,8 +83,10 @@ function WarehouseRoot(props: IProps): React.ReactElement {
const mats = []; const mats = [];
for (const matName of Object.keys(props.warehouse.materials)) { for (const matName of Object.keys(props.warehouse.materials)) {
if (!(props.warehouse.materials[matName] instanceof Material)) continue; if (!(props.warehouse.materials[matName] instanceof Material)) continue;
// Only create UI for materials that are relevant for the industry // Only create UI for materials that are relevant for the industry or in stock
if (!isRelevantMaterial(matName, division)) continue; const isInStock = props.warehouse.materials[matName].qty > 0;
const isRelevant = isRelevantMaterial(matName, division);
if (!isInStock && !isRelevant) continue;
mats.push( mats.push(
<MaterialElem <MaterialElem
rerender={props.rerender} rerender={props.rerender}