fix: suspense armor laoder

This commit is contained in:
tresabhi committed 2024-12-13 16:45:59 -06:00
1 parent d937f62ac1
commit 4122ff5bf1
2 files changed
+5 -2

No files matched your search

@@ -27,7 +27,7 @@ import {
Text,
Tooltip,
} from '@radix-ui/themes';
import { useState, type RefObject } from 'react';
import { Suspense, useState, type RefObject } from 'react';
import { ENVIRONMENTS } from '../../../../../constants/lightingEnvironments';
import { Pose, poseEvent } from '../../../../../core/blitzkit/pose';
import { useEquipment } from '../../../../../hooks/useEquipment';
@@ -310,7 +310,9 @@ export function Options({ thicknessRange, canvas }: OptionsProps) {
</IconButton>
</Flex>
<DynamicArmorSwitcher />
<Suspense>
<DynamicArmorSwitcher />
</Suspense>
</Flex>
)}
+1
View File
@@ -9,6 +9,7 @@ const cache: Record<
export function useArmor(id: number) {
const gltf = useLoader(GLTFLoader, asset(`3d/tanks/armor/${id}.glb`));
if (!cache[id]) {
cache[id] = {
gltf,