From 6ad2f156d7fdb5f9ae87d859bb6c7cfce49a86a1 Mon Sep 17 00:00:00 2001 From: phyzical Date: Thu, 24 Mar 2022 23:13:54 +0800 Subject: [PATCH] recovery screen fix for when augmenting and working --- src/ui/WorkInProgressRoot.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ui/WorkInProgressRoot.tsx b/src/ui/WorkInProgressRoot.tsx index b1d2cf871..56b1d96ae 100644 --- a/src/ui/WorkInProgressRoot.tsx +++ b/src/ui/WorkInProgressRoot.tsx @@ -41,8 +41,8 @@ export function WorkInProgressRoot(): React.ReactElement { return ( <> - You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this time, - please try again if you think this should have worked + You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this + time, please try again if you think this should have worked @@ -217,11 +217,19 @@ export function WorkInProgressRoot(): React.ReactElement { if (player.workType == CONSTANTS.WorkTypeCompany) { const comp = Companies[player.companyName]; - let companyRep = 0; if (comp == null || !(comp instanceof Company)) { - throw new Error(`Could not find Company: ${player.companyName}`); + return ( + <> + + You cannot work for {player.companyName || "(Company not found)"} at this time, please try again if you + think this should have worked + + + + ); } - companyRep = comp.playerReputation; + + const companyRep = comp.playerReputation; function cancel(): void { player.finishWork(true);