mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 04:35:46 +01:00
MISC: Minor code change in SkillElem.tsx (#1751)
This commit is contained in:
parent
81e068ba9c
commit
c7cf0b853b
@ -21,7 +21,7 @@ export function SkillElem({ skill, bladeburner, onUpgrade }: SkillElemProps): Re
|
||||
// No need to support "+1" button when the skill level reaches Number.MAX_SAFE_INTEGER.
|
||||
const isSupported = skillLevel < Number.MAX_SAFE_INTEGER;
|
||||
// Use skill.canUpgrade() instead of reimplementing all conditional checks.
|
||||
const canLevel = isSupported ? skill.canUpgrade(bladeburner, 1).available ?? false : false;
|
||||
const canLevel = isSupported && skill.canUpgrade(bladeburner, 1).available;
|
||||
/**
|
||||
* maxLvl is only useful when we check if we should show "MAX LEVEL". For the check of the icon button, we don't need
|
||||
* it. This condition is checked in skill.canUpgrade().
|
||||
|
Loading…
Reference in New Issue
Block a user