fix not being able to work on program

This commit is contained in:
Olivier Gagnon 2022-03-10 23:05:35 -05:00
parent a35b95a58b
commit 81d3246cb8

@ -35,27 +35,29 @@ export function WorkInProgressRoot(): React.ReactElement {
const player = use.Player(); const player = use.Player();
const router = use.Router(); const router = use.Router();
const faction = Factions[player.currentWorkFactionName];
if (!faction) {
return (
<Grid container direction="column" justifyContent="center" alignItems="center" style={{ minHeight: "100vh" }}>
<Grid item>
<Typography>
Something has gone wrong, you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at this time.
</Typography>
</Grid>
</Grid>
)
}
if (player.workType == CONSTANTS.WorkTypeFaction) { if (player.workType == CONSTANTS.WorkTypeFaction) {
const faction = Factions[player.currentWorkFactionName];
if (!faction) { if (!faction) {
return <> return (
<Typography variant="h4" color="primary"> <Grid container direction="column" justifyContent="center" alignItems="center" style={{ minHeight: "100vh" }}>
You have not joined {faction} yet! <Grid item>
</Typography> <Typography>
<Button onClick={() => router.toFactions()}>Back to Factions</Button> Something has gone wrong, you cannot work for {player.currentWorkFactionName || "(Faction not found)"} at
</> this time.
</Typography>
</Grid>
</Grid>
);
}
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 {