From 82fe86820f28bd23f1947dc8e3b6d2281158f949 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Mon, 17 Jan 2022 07:55:11 -0500 Subject: [PATCH] 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. --- src/Sidebar/ui/SidebarRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sidebar/ui/SidebarRoot.tsx b/src/Sidebar/ui/SidebarRoot.tsx index 0e51a2175..ceca9a8e4 100644 --- a/src/Sidebar/ui/SidebarRoot.tsx +++ b/src/Sidebar/ui/SidebarRoot.tsx @@ -297,7 +297,7 @@ export function SidebarRoot(props: IProps): React.ReactElement { } else if (event.keyCode === KEY.W && event.altKey) { event.preventDefault(); 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 event.preventDefault(); clickJob();