From 39299f6e1743d23750c538df3b36944ab694363e Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Wed, 22 Apr 2026 04:18:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B8=85=E7=90=86=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20import=20=E5=92=8C=E6=B7=BB=E5=8A=A0=20spr?= =?UTF-8?q?iteCache=20=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SpeciesDetail.tsx: 移除未使用的 SPECIES_PERSONALITY import - CompanionCard.tsx: 移除未使用的 SPECIES_I18N import - spriteCache.ts: 空 catch 块添加错误日志输出 Co-Authored-By: Claude Opus 4.6 --- packages/pokemon/src/core/spriteCache.ts | 6 ++++-- packages/pokemon/src/ui/CompanionCard.tsx | 2 +- packages/pokemon/src/ui/SpeciesDetail.tsx | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/pokemon/src/core/spriteCache.ts b/packages/pokemon/src/core/spriteCache.ts index b363de9fb..42a5ee9c0 100644 --- a/packages/pokemon/src/core/spriteCache.ts +++ b/packages/pokemon/src/core/spriteCache.ts @@ -32,7 +32,8 @@ export function loadSprite(speciesId: SpeciesId): SpriteCache | null { try { const raw = readFileSync(filePath, 'utf-8') return JSON.parse(raw) as SpriteCache - } catch { + } catch (e) { + console.error(`[buddy] Failed to load sprite cache for ${speciesId}:`, e) return null } } @@ -73,7 +74,8 @@ export async function fetchAndCacheSprite(speciesId: SpeciesId): Promise