From f7dcf5ca97a91d609d5e6b0a4611493e6e2ee3ba Mon Sep 17 00:00:00 2001 From: phyzical Date: Wed, 9 Mar 2022 22:09:14 +0800 Subject: [PATCH 1/3] 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); From e5acd10c86f4fa51e36094521d2f20ba09576b30 Mon Sep 17 00:00:00 2001 From: phyzical Date: Wed, 9 Mar 2022 22:14:42 +0800 Subject: [PATCH 2/3] moved to only apply when working for faction --- src/ui/WorkInProgressRoot.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index 2490402a9..130df6067 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -36,16 +36,16 @@ export function WorkInProgressRoot(): React.ReactElement { 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) { + if (!faction) { + return <> + + Sorry, You have not joined the faction {faction} yet! + + + + } + function cancel(): void { router.toFaction(faction); player.finishFactionWork(true); @@ -135,7 +135,6 @@ export function WorkInProgressRoot(): React.ReactElement { } function unfocus(): void { - router.toFaction(faction); router.toCity(); player.stopFocusing(); } From a3555d101ebabc66b2bcbf80b6f086bbaec891f6 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 9 Mar 2022 22:50:41 +0800 Subject: [PATCH 3/3] Update src/ui/WorkInProgressRoot.tsx --- src/ui/WorkInProgressRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index 130df6067..b8ff2de59 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -40,7 +40,7 @@ export function WorkInProgressRoot(): React.ReactElement { if (!faction) { return <> - Sorry, You have not joined the faction {faction} yet! + You have not joined {faction} yet!