mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: suspense armor laoder
This commit is contained in:
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>
|
||||
)}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user