Fix SkillStudyProgress.tsx to use modular skillStore instead of legacy store
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useGameStore } from '@/lib/game/store';
|
||||
import { useSkillStore } from '@/lib/game/stores';
|
||||
import { SKILLS_DEF } from '@/lib/game/constants';
|
||||
import { formatStudyTime } from './skills-utils';
|
||||
import { useStudyStats } from '@/lib/game/hooks/useGameDerived';
|
||||
@@ -9,12 +9,13 @@ import { Button } from '@/components/ui/button';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
|
||||
export function SkillStudyProgress() {
|
||||
const store = useGameStore();
|
||||
const currentStudyTarget = useSkillStore((s) => s.currentStudyTarget);
|
||||
const cancelStudy = useSkillStore((s) => s.cancelStudy);
|
||||
const { studySpeedMult } = useStudyStats();
|
||||
|
||||
if (!store.currentStudyTarget) return null;
|
||||
if (!currentStudyTarget) return null;
|
||||
|
||||
const target = store.currentStudyTarget;
|
||||
const target = currentStudyTarget;
|
||||
const progressPct = Math.min(100, (target.progress / target.required) * 100);
|
||||
const def = SKILLS_DEF[target.id] || SKILLS_DEF[target.id.split('_t')[0]];
|
||||
|
||||
@@ -31,7 +32,7 @@ export function SkillStudyProgress() {
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 w-6 p-0 text-gray-400 hover:text-white"
|
||||
onClick={() => store.cancelStudy()}
|
||||
onClick={() => cancelStudy(0)}
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user