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 = [];
for (const matName of Object.keys(props.warehouse.materials)) {
if (!(props.warehouse.materials[matName] instanceof Material)) continue;
// Only create UI for materials that are relevant for the industry
if (!isRelevantMaterial(matName, division)) continue;
// Only create UI for materials that are relevant for the industry or in stock
const isInStock = props.warehouse.materials[matName].qty > 0;
const isRelevant = isRelevantMaterial(matName, division);
if (!isInStock && !isRelevant) continue;
mats.push(
<MaterialElem
rerender={props.rerender}