From 2164b563d045017675ee32be3346284d8d96ed6c Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 3 Dec 2022 19:01:45 -0800 Subject: [PATCH] Fix race condition when selecting job for first time --- components/JobSection/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index c372b211..55ea8234 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -60,7 +60,8 @@ const JobSection = (props: Props) => { useEffect(() => { if (job) { - if (job.id != party.job.id) appState.party.job = job + if ((party.job && job.id != party.job.id) || !party.job) + appState.party.job = job if (job.row === "1") setNumSkills(3) else setNumSkills(4) }