Fix corp not moving

This commit is contained in:
Olivier Gagnon
2021-09-21 17:38:51 -04:00
parent 9a6b185141
commit 2a8b1c2116
2 changed files with 5 additions and 0 deletions

@ -4,10 +4,12 @@ import { IPlayer } from "../../PersonObjects/IPlayer";
import { removePopup } from "../../ui/React/createPopup"; import { removePopup } from "../../ui/React/createPopup";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { dialogBoxCreate } from "../../../utils/DialogBox"; import { dialogBoxCreate } from "../../../utils/DialogBox";
import { IRouter } from "../../ui/Router";
interface IProps { interface IProps {
player: IPlayer; player: IPlayer;
popupId: string; popupId: string;
router: IRouter;
} }
export function CreateCorporationPopup(props: IProps): React.ReactElement { export function CreateCorporationPopup(props: IProps): React.ReactElement {
@ -40,6 +42,7 @@ export function CreateCorporationPopup(props: IProps): React.ReactElement {
"and manage your company in the City.", "and manage your company in the City.",
); );
removePopup(props.popupId); removePopup(props.popupId);
props.router.toCorporation();
} }
function seed(): void { function seed(): void {
@ -55,6 +58,7 @@ export function CreateCorporationPopup(props: IProps): React.ReactElement {
"You can visit and manage your company in the City.", "You can visit and manage your company in the City.",
); );
removePopup(props.popupId); removePopup(props.popupId);
props.router.toCorporation();
} }
return ( return (

@ -41,6 +41,7 @@ export function SpecialLocation(props: IProps): React.ReactElement {
createPopup(popupId, CreateCorporationPopup, { createPopup(popupId, CreateCorporationPopup, {
player: player, player: player,
popupId: popupId, popupId: popupId,
router: router,
}); });
} }