From dc86e712cb2ddd9809dcecb5ca966fba18fa7f70 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 23 Dec 2022 15:47:39 -0800 Subject: [PATCH] Fix canEditSkill --- components/JobSection/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index 09e78b8f..50b390a7 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -84,11 +84,13 @@ const JobSection = (props: Props) => { } const canEditSkill = (skill?: JobSkill) => { - if (job && skill) { - if (skill.job.id === job.id && skill.main && !skill.sub) return false - } + // If there is a job and a skill present in the slot + if (job) { + // If the skill's job is one of the job's main skill + if (skill && skill.job.id === job.id && skill.main) return false - return props.editable + return props.editable + } else return false } const skillItem = (index: number, editable: boolean) => {