From 81d3246cb8fbccb39d2f3e9226ebf00168f7a482 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 10 Mar 2022 23:05:35 -0500 Subject: [PATCH] fix not being able to work on program --- src/ui/WorkInProgressRoot.tsx | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index 005aabafc..7a4c1802a 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -35,27 +35,29 @@ export function WorkInProgressRoot(): React.ReactElement { const player = use.Player(); const router = use.Router(); - const faction = Factions[player.currentWorkFactionName]; - if (!faction) { - return ( - - - - Something has gone wrong, you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time. - - - - ) - } - if (player.workType == CONSTANTS.WorkTypeFaction) { + const faction = Factions[player.currentWorkFactionName]; if (!faction) { - return <> - - You have not joined {faction} yet! - - - + return ( + + + + Something has gone wrong, you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at + this time. + + + + ); + } + if (!faction) { + return ( + <> + + You have not joined {faction} yet! + + + + ); } function cancel(): void {