mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Fix incorrect progress (#516)
This commit is contained in:
parent
2e9dc32deb
commit
9d9f6b4dcd
@ -97,11 +97,10 @@ interface SkillBarProps {
|
||||
color?: string;
|
||||
}
|
||||
function SkillBar({ name, color }: SkillBarProps): React.ReactElement {
|
||||
const [mult, setMult] = useState(skillMultUpdaters[name]());
|
||||
const [progress, setProgress] = useState(calculateSkillProgress(Player.exp[skillNameMap[name]], mult));
|
||||
const [progress, setProgress] = useState(calculateSkillProgress(0));
|
||||
useEffect(() => {
|
||||
const clearSubscription = OverviewEventEmitter.subscribe(() => {
|
||||
setMult(skillMultUpdaters[name]());
|
||||
const mult = skillMultUpdaters[name]();
|
||||
setProgress(calculateSkillProgress(Player.exp[skillNameMap[name]], mult));
|
||||
});
|
||||
return clearSubscription;
|
||||
|
Loading…
Reference in New Issue
Block a user