Make throw party UI reflect if we're throwing a party

This commit is contained in:
Staszek Welsh 2022-06-01 23:45:29 +01:00
parent 04efd899a0
commit fe83ca0f3f
2 changed files with 11 additions and 7 deletions

@ -464,8 +464,8 @@ export function IndustryOffice(props: IProps): React.ReactElement {
title={<Typography>Throw an office party to increase your employee's morale and happiness</Typography>}
>
<span>
<Button disabled={corp.funds < 0} onClick={() => setThrowPartyOpen(true)}>
Throw Party
<Button disabled={corp.funds < 0 || props.office.partyMult > 0} onClick={() => setThrowPartyOpen(true)}>
{props.office.partyMult > 0 ? "Throwing Party..." : "Throw Party"}
</Button>
</span>
</Tooltip>

@ -38,11 +38,15 @@ export function ThrowPartyModal(props: IProps): React.ReactElement {
dialogBoxCreate("You don't have enough company funds to throw a party!");
} else {
const mult = ThrowParty(corp, props.office, cost);
dialogBoxCreate(
"You threw a party for the office! The morale and happiness " +
"of each employee increased by " +
numeralWrapper.formatPercentage(mult - 1),
);
if (mult > 0) {
dialogBoxCreate(
"You threw a party for the office! The morale and happiness " +
"of each employee increased by " +
numeralWrapper.formatPercentage(mult - 1),
);
}
props.rerender();
props.onClose();
}