debug(v2): add earlier console.log to trace inventory fetch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
87598e0952
commit
a2f77e1061
3 changed files with 8 additions and 4 deletions
|
|
@ -166,13 +166,17 @@ export const InventoryWindow: React.FC<Props> = ({ id, charName, zIndex }) => {
|
|||
const [cantripState, setCantripState] = useState<any>(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[INV] Loading inventory for', charName);
|
||||
setLoading(true);
|
||||
Promise.all([
|
||||
apiFetch<any>(`/inventory/${encodeURIComponent(charName)}?limit=1000`).catch(() => ({ items: [] })),
|
||||
apiFetch<any>(`/inventory/${encodeURIComponent(charName)}?limit=1000`).catch(e => { console.error('[INV] fetch error:', e); return { items: [] }; }),
|
||||
apiFetch<any>(`/character-stats/${encodeURIComponent(charName)}`).catch(() => null),
|
||||
]).then(([inv, stats]) => {
|
||||
const rawItems = inv.items ?? [];
|
||||
setItems(rawItems.map(normalizeItem));
|
||||
console.log('[INV] Got', rawItems.length, 'raw items, first:', rawItems[0]);
|
||||
const normalized = rawItems.map(normalizeItem);
|
||||
console.log('[INV] Normalized', normalized.length, 'items, sample container_ids:', normalized.slice(0, 5).map((i: any) => i.container_id));
|
||||
setItems(normalized);
|
||||
setCharStats(stats);
|
||||
}).finally(() => setLoading(false));
|
||||
}, [charName]);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Mosswart Overlord v2</title>
|
||||
<link rel="icon" type="image/png" href="/icons/7735.png" />
|
||||
<script type="module" crossorigin src="/v2/assets/index-SyvbSo1H.js"></script>
|
||||
<script type="module" crossorigin src="/v2/assets/index-Belkz_Ci.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/v2/assets/index-DrsM2PEe.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue