mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01: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,
|
Text,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { useState, type RefObject } from 'react';
|
import { Suspense, useState, type RefObject } from 'react';
|
||||||
import { ENVIRONMENTS } from '../../../../../constants/lightingEnvironments';
|
import { ENVIRONMENTS } from '../../../../../constants/lightingEnvironments';
|
||||||
import { Pose, poseEvent } from '../../../../../core/blitzkit/pose';
|
import { Pose, poseEvent } from '../../../../../core/blitzkit/pose';
|
||||||
import { useEquipment } from '../../../../../hooks/useEquipment';
|
import { useEquipment } from '../../../../../hooks/useEquipment';
|
||||||
@@ -310,7 +310,9 @@ export function Options({ thicknessRange, canvas }: OptionsProps) {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<DynamicArmorSwitcher />
|
<Suspense>
|
||||||
|
<DynamicArmorSwitcher />
|
||||||
|
</Suspense>
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const cache: Record<
|
|||||||
|
|
||||||
export function useArmor(id: number) {
|
export function useArmor(id: number) {
|
||||||
const gltf = useLoader(GLTFLoader, asset(`3d/tanks/armor/${id}.glb`));
|
const gltf = useLoader(GLTFLoader, asset(`3d/tanks/armor/${id}.glb`));
|
||||||
|
|
||||||
if (!cache[id]) {
|
if (!cache[id]) {
|
||||||
cache[id] = {
|
cache[id] = {
|
||||||
gltf,
|
gltf,
|
||||||
|
|||||||
Reference in new issue
Block a user