Merge pull request #3101 from phyzical/bugfix/work-in-progress-augment-fix

work in progress augment fix
This commit is contained in:
hydroflame 2022-03-10 21:38:45 -05:00 committed by GitHub
commit 1a9b3bd113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,10 +31,21 @@ export function WorkInProgressRoot(): React.ReactElement {
const id = setInterval(rerender, CONSTANTS.MilliPerCycle); const id = setInterval(rerender, CONSTANTS.MilliPerCycle);
return () => clearInterval(id); return () => clearInterval(id);
}, []); }, []);
const player = use.Player(); const player = use.Player();
const router = use.Router(); const router = use.Router();
const faction = Factions[player.currentWorkFactionName]; const faction = Factions[player.currentWorkFactionName];
if (player.workType == CONSTANTS.WorkTypeFaction) { 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 { function cancel(): void {
router.toFaction(faction); router.toFaction(faction);
player.finishFactionWork(true); player.finishFactionWork(true);
@ -124,7 +135,6 @@ export function WorkInProgressRoot(): React.ReactElement {
} }
function unfocus(): void { function unfocus(): void {
router.toFaction(faction);
router.toCity(); router.toCity();
player.stopFocusing(); player.stopFocusing();
} }