Change job shortcut test to match sidebar item

I switched it to match the same condition as the sidebar menu item,
which checks for player.companyName, which should be set to the latest
company the player worked at. This can prevent a crash loading the jobs
page with an invalid companyName.

This fixes a problem a user had where the player.companyName was empty
while actually items in player.jobs, but I could not figure out how
to replicate. It may have had something to do with part-time jobs.
This commit is contained in:
Martin Fournier 2022-01-17 07:55:11 -05:00
parent 8b69fd7faa
commit 82fe86820f

@ -297,7 +297,7 @@ export function SidebarRoot(props: IProps): React.ReactElement {
} else if (event.keyCode === KEY.W && event.altKey) { } else if (event.keyCode === KEY.W && event.altKey) {
event.preventDefault(); event.preventDefault();
clickCity(); clickCity();
} else if (event.keyCode === KEY.J && event.altKey && !event.ctrlKey && !event.metaKey && props.player.hasJob()) { } else if (event.keyCode === KEY.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {
// ctrl/cmd + alt + j is shortcut to open Chrome dev tools // ctrl/cmd + alt + j is shortcut to open Chrome dev tools
event.preventDefault(); event.preventDefault();
clickJob(); clickJob();