Merge pull request #3068 from phyzical/hotfix/2902

Fix for work in progress modal when augmenting
This commit is contained in:
hydroflame 2022-03-10 21:41:48 -05:00 committed by GitHub
commit 459296c160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

@ -933,6 +933,8 @@ export function startFactionSecurityWork(this: IPlayer, faction: Faction): void
export function workForFaction(this: IPlayer, numCycles: number): boolean {
const faction = Factions[this.currentWorkFactionName];
if (!faction) { return false; }
//Constantly update the rep gain rate
switch (this.factionWorkType) {
case CONSTANTS.FactionWorkHacking:

@ -36,6 +36,18 @@ export function WorkInProgressRoot(): React.ReactElement {
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 (!faction) {
return <>