From f7dcf5ca97a91d609d5e6b0a4611493e6e2ee3ba Mon Sep 17 00:00:00 2001 From: phyzical Date: Wed, 9 Mar 2022 22:09:14 +0800 Subject: [PATCH] add early out to say "sorry not part of faction when working and augmenting" --- src/ui/WorkInProgressRoot.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index d43843c85..2490402a9 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -31,9 +31,20 @@ export function WorkInProgressRoot(): React.ReactElement { const id = setInterval(rerender, CONSTANTS.MilliPerCycle); return () => clearInterval(id); }, []); + const player = use.Player(); const router = use.Router(); + const faction = Factions[player.currentWorkFactionName]; + if (!faction) { + return <> + + Sorry, You have not joined the faction {faction} yet! + + + + } + if (player.workType == CONSTANTS.WorkTypeFaction) { function cancel(): void { router.toFaction(faction);