fix: migrate golemancy/activity/achievements, fix CraftingTab/SkillsTab/SpireTab/GolemancyTab/AchievementsTab store reads
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m1s

This commit is contained in:
Refactoring Agent
2026-05-05 16:11:28 +02:00
parent ed616738fd
commit ed69a8f2b4
9 changed files with 352 additions and 140 deletions
+11 -11
View File
@@ -13,18 +13,18 @@ import {
EnchantmentApplier,
EquipmentCrafter,
} from '@/components/game/crafting';
import { useGameStore } from '@/lib/game/stores';
import { useCombatStore, useCraftingStore } from '@/lib/game/stores';
import { useGameToast } from '@/components/game/GameToast';
export function CraftingTab() {
const showToast = useGameToast();
const currentAction = useGameStore((s) => s.currentAction);
const designProgress = useGameStore((s) => s.designProgress);
const preparationProgress = useGameStore((s) => s.preparationProgress);
const applicationProgress = useGameStore((s) => s.applicationProgress);
const equipmentCraftingProgress = useGameStore((s) => s.equipmentCraftingProgress);
const pauseApplication = useGameStore((s) => s.pauseApplication);
const resumeApplication = useGameStore((s) => s.resumeApplication);
const currentAction = useCombatStore((s) => s.currentAction);
const designProgress = useCraftingStore((s) => s.designProgress);
const preparationProgress = useCraftingStore((s) => s.preparationProgress);
const applicationProgress = useCraftingStore((s) => s.applicationProgress);
const equipmentCraftingProgress = useCraftingStore((s) => s.equipmentCraftingProgress);
const pauseApplication = useCraftingStore((s) => s.pauseApplication);
const resumeApplication = useCraftingStore((s) => s.resumeApplication);
const [activeTab, setActiveTab] = useState<'fabricate' | 'enchant'>('fabricate');
const [enchantStage, setEnchantStage] = useState<'design' | 'prepare' | 'apply'>('design');
@@ -176,7 +176,7 @@ export function CraftingTab() {
<SectionHeader
title="Designing Enchantment"
action={
<ActionButton variant="ghost" size="sm" onClick={() => useGameStore.getState().cancelDesign()}>
<ActionButton variant="ghost" size="sm" onClick={() => useCraftingStore.getState().cancelDesign()}>
Cancel
</ActionButton>
}
@@ -198,7 +198,7 @@ export function CraftingTab() {
<SectionHeader
title="Preparing Equipment"
action={
<ActionButton variant="ghost" size="sm" onClick={() => useGameStore.getState().cancelPreparation()}>
<ActionButton variant="ghost" size="sm" onClick={() => useCraftingStore.getState().cancelPreparation()}>
Cancel
</ActionButton>
}
@@ -230,7 +230,7 @@ export function CraftingTab() {
<>
<ActionButton variant="secondary" size="sm" onClick={pauseApplication}>Pause</ActionButton>
<ActionButton variant="ghost" size="sm" onClick={() => {
useGameStore.getState().cancelApplication();
useCraftingStore.getState().cancelApplication();
showToast('warning', 'Enchantment Cancelled', 'The enchantment application was cancelled.');
}}>Cancel</ActionButton>
</>