Fix canEditSkill
This commit is contained in:
parent
2d2497b8da
commit
dc86e712cb
1 changed files with 6 additions and 4 deletions
|
|
@ -84,11 +84,13 @@ const JobSection = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const canEditSkill = (skill?: JobSkill) => {
|
const canEditSkill = (skill?: JobSkill) => {
|
||||||
if (job && skill) {
|
// If there is a job and a skill present in the slot
|
||||||
if (skill.job.id === job.id && skill.main && !skill.sub) return false
|
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) => {
|
const skillItem = (index: number, editable: boolean) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue