Merge branch 'dev' into improvement/aug-page-link

This commit is contained in:
hydroflame
2022-03-10 21:40:58 -05:00
committed by GitHub
6 changed files with 108 additions and 76 deletions
+11 -1
View File
@@ -31,10 +31,21 @@ 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 (player.workType == CONSTANTS.WorkTypeFaction) {
if (!faction) {
return <>
<Typography variant="h4" color="primary">
You have not joined {faction} yet!
</Typography>
<Button onClick={() => router.toFactions()}>Back to Factions</Button>
</>
}
function cancel(): void {
router.toFaction(faction);
player.finishFactionWork(true);
@@ -124,7 +135,6 @@ export function WorkInProgressRoot(): React.ReactElement {
}
function unfocus(): void {
router.toFaction(faction);
router.toCity();
player.stopFocusing();
}