fix hand tracking glove fallback and loading

This commit is contained in:
Tom Boullay
2026-05-02 11:35:28 +02:00
parent fe662ebe7d
commit ac7f60060c
4 changed files with 35 additions and 29 deletions
+3 -3
View File
@@ -28,11 +28,11 @@ const HAND_CONNECTIONS: Array<[number, number]> = [
export function HandTrackingVisualizer(): React.JSX.Element | null {
const { hands, status } = useHandTrackingSnapshot();
const gloves = useHandTrackingGloveStatus((state) => state.gloves);
const shouldShowSvgFallback = Object.values(gloves).some(
(gloveStatus) => gloveStatus === "error" || gloveStatus === "idle",
const hasLoadedGlove = Object.values(gloves).some(
(gloveStatus) => gloveStatus === "loaded",
);
if (status === "idle" || hands.length === 0 || !shouldShowSvgFallback) {
if (status === "idle" || hands.length === 0 || hasLoadedGlove) {
return null;
}