chore: address code quality audit findings
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-28 08:31:42 +02:00
parent 947025cbf5
commit d654565f87
73 changed files with 890 additions and 1457 deletions
+17 -5
View File
@@ -7,8 +7,9 @@ import {
} from "@/hooks/animation/useAnimatedModel";
import { useLoggedGLTF } from "@/hooks/three/useLoggedGLTF";
import type { ModelTransformProps } from "@/types/three/three";
import { logger } from "@/utils/core/Logger";
export interface AnimatedModelConfig extends ModelTransformProps {
interface AnimatedModelConfig extends ModelTransformProps {
modelPath: string;
animations?: string[];
defaultAnimation?: string;
@@ -121,17 +122,28 @@ export function AnimatedModel({
return;
}
let defaultAction = actions[defaultAnimation as string];
let defaultAction = actions[defaultAnimation];
if (!defaultAction && names.length > 0) {
defaultAction = actions[names[0] as string];
const fallbackAnimation = names[0];
if (!defaultAction && fallbackAnimation) {
logger.warn(
"AnimatedModel",
"Default animation missing, using fallback",
{
modelPath,
defaultAnimation,
fallbackAnimation,
availableAnimations: names,
},
);
defaultAction = actions[fallbackAnimation];
}
if (defaultAction) {
defaultAction.play();
onLoaded?.();
}
}, [actions, defaultAnimation, names, autoPlay, onLoaded]);
}, [actions, defaultAnimation, modelPath, names, autoPlay, onLoaded]);
const contextValue: AnimatedModelContextValue = {
play,