From fe83ca0f3f06bef64e6604fb4d77554900e3f88e Mon Sep 17 00:00:00 2001 From: Staszek Welsh Date: Wed, 1 Jun 2022 23:45:29 +0100 Subject: [PATCH] Make throw party UI reflect if we're throwing a party --- src/Corporation/ui/IndustryOffice.tsx | 4 ++-- src/Corporation/ui/modals/ThrowPartyModal.tsx | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Corporation/ui/IndustryOffice.tsx b/src/Corporation/ui/IndustryOffice.tsx index ba80822a3..b5f040a0b 100644 --- a/src/Corporation/ui/IndustryOffice.tsx +++ b/src/Corporation/ui/IndustryOffice.tsx @@ -464,8 +464,8 @@ export function IndustryOffice(props: IProps): React.ReactElement { title={Throw an office party to increase your employee's morale and happiness} > - diff --git a/src/Corporation/ui/modals/ThrowPartyModal.tsx b/src/Corporation/ui/modals/ThrowPartyModal.tsx index 1df61aac0..8bbd9d3f7 100644 --- a/src/Corporation/ui/modals/ThrowPartyModal.tsx +++ b/src/Corporation/ui/modals/ThrowPartyModal.tsx @@ -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(); }