moved to only apply when working for faction

This commit is contained in:
phyzical 2022-03-09 22:14:42 +08:00
parent f7dcf5ca97
commit e5acd10c86

@ -36,6 +36,7 @@ export function WorkInProgressRoot(): React.ReactElement {
const router = use.Router(); const router = use.Router();
const faction = Factions[player.currentWorkFactionName]; const faction = Factions[player.currentWorkFactionName];
if (player.workType == CONSTANTS.WorkTypeFaction) {
if (!faction) { if (!faction) {
return <> return <>
<Typography variant="h4" color="primary"> <Typography variant="h4" color="primary">
@ -45,7 +46,6 @@ export function WorkInProgressRoot(): React.ReactElement {
</> </>
} }
if (player.workType == CONSTANTS.WorkTypeFaction) {
function cancel(): void { function cancel(): void {
router.toFaction(faction); router.toFaction(faction);
player.finishFactionWork(true); player.finishFactionWork(true);
@ -135,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();
} }