mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-01 20:13:51 +01:00
CORPORATION: Check there is room to make a new product before opening popup. (#147)
This commit is contained in:
parent
e9e9ac1def
commit
3861e56ced
@ -33,6 +33,11 @@ function MakeProductButton(): React.ReactElement {
|
|||||||
return Object.keys(division.products).length === 0;
|
return Object.keys(division.products).length === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onButtonClick() {
|
||||||
|
if (hasMaxProducts) return;
|
||||||
|
setMakeOpen(true);
|
||||||
|
}
|
||||||
|
|
||||||
let createProductButtonText = "";
|
let createProductButtonText = "";
|
||||||
switch (division.type) {
|
switch (division.type) {
|
||||||
case Industries.Food:
|
case Industries.Food:
|
||||||
@ -78,7 +83,7 @@ function MakeProductButton(): React.ReactElement {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Button color={shouldFlash() ? "error" : "primary"} onClick={() => setMakeOpen(true)} disabled={corp.funds < 0}>
|
<Button color={shouldFlash() ? "error" : "primary"} onClick={onButtonClick} disabled={corp.funds < 0}>
|
||||||
{createProductButtonText}
|
{createProductButtonText}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
Loading…
Reference in New Issue
Block a user