From a389b515dff4ab71ddcca7d47822236391db6abd Mon Sep 17 00:00:00 2001 From: phyzical Date: Sat, 5 Mar 2022 13:05:37 +0800 Subject: [PATCH] fix for work in progress modal when augmenting * added an early out to turns a basic error for the work modal when the current work faction to show the faction or faction not found --- src/ui/WorkInProgressRoot.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index d43843c85..a2ebf2b24 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -34,6 +34,18 @@ export function WorkInProgressRoot(): React.ReactElement { const player = use.Player(); const router = use.Router(); const faction = Factions[player.currentWorkFactionName]; + if (!faction) { + return ( + + + + Sorry, Something has gone wrong you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time + + + + ) + } + if (player.workType == CONSTANTS.WorkTypeFaction) { function cancel(): void { router.toFaction(faction);