mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +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;
|
||||
}
|
||||
|
||||
function onButtonClick() {
|
||||
if (hasMaxProducts) return;
|
||||
setMakeOpen(true);
|
||||
}
|
||||
|
||||
let createProductButtonText = "";
|
||||
switch (division.type) {
|
||||
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}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
Loading…
Reference in New Issue
Block a user