fix: complete store migration — fix all tab crashes and ghost field reads
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
This commit is contained in:
@@ -4,23 +4,25 @@ import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Sparkles, Unlock } from 'lucide-react';
|
||||
import { ATTUNEMENTS_DEF } from '@/lib/game/data/attunements';
|
||||
import { useGameStore } from '@/lib/game/store';
|
||||
import { usePrestigeStore } from '@/lib/game/stores';
|
||||
|
||||
export function AttunementDebug() {
|
||||
const store = useGameStore((s) => s);
|
||||
|
||||
const attunements = usePrestigeStore((s) => s.attunements);
|
||||
const debugUnlockAttunement = usePrestigeStore((s) => s.debugUnlockAttunement);
|
||||
const debugAddAttunementXP = usePrestigeStore((s) => s.debugAddAttunementXP);
|
||||
|
||||
const handleUnlockAttunement = (id: string) => {
|
||||
if (useGameStore.getState().debugUnlockAttunement) {
|
||||
useGameStore.getState().debugUnlockAttunement(id);
|
||||
if (debugUnlockAttunement) {
|
||||
debugUnlockAttunement(id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleAddAttunementXP = (id: string, amount: number) => {
|
||||
if (useGameStore.getState().debugAddAttunementXP) {
|
||||
useGameStore.getState().debugAddAttunementXP(id, amount);
|
||||
if (debugAddAttunementXP) {
|
||||
debugAddAttunementXP(id, amount);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Card className="bg-gray-900/80 border-gray-700">
|
||||
<CardHeader className="pb-2">
|
||||
@@ -31,10 +33,10 @@ export function AttunementDebug() {
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
{Object.entries(ATTUNEMENTS_DEF).map(([id, def]) => {
|
||||
const isActive = store.attunements?.[id]?.active;
|
||||
const level = store.attunements?.[id]?.level || 1;
|
||||
const xp = store.attunements?.[id]?.experience || 0;
|
||||
|
||||
const isActive = attunements?.[id]?.active;
|
||||
const level = attunements?.[id]?.level || 1;
|
||||
const xp = attunements?.[id]?.experience || 0;
|
||||
|
||||
return (
|
||||
<div key={id} className="flex items-center justify-between p-2 bg-gray-800/50 rounded">
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user