From 3861e56ced3d68db75fc3c058c95ea691db36f57 Mon Sep 17 00:00:00 2001 From: G4mingJon4s <40526179+G4mingJon4s@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:58:51 +0200 Subject: [PATCH] CORPORATION: Check there is room to make a new product before opening popup. (#147) --- src/Corporation/ui/IndustryOverview.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Corporation/ui/IndustryOverview.tsx b/src/Corporation/ui/IndustryOverview.tsx index 970cbb66c..ce224e8fc 100644 --- a/src/Corporation/ui/IndustryOverview.tsx +++ b/src/Corporation/ui/IndustryOverview.tsx @@ -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 { ) } > -