Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -119,6 +119,14 @@ export function CloudLoader({ compact = false, variant = 'outline', className }:
|
|||||||
const response = await smartFetch(rawUrl);
|
const response = await smartFetch(rawUrl);
|
||||||
const buffer = await response.arrayBuffer();
|
const buffer = await response.arrayBuffer();
|
||||||
|
|
||||||
|
// Valida tamanho + assinatura antes de converter
|
||||||
|
const sig = validateModelFile(fileName, buffer.byteLength, ext, buffer);
|
||||||
|
if (!sig.ok) {
|
||||||
|
toast.error(sig.reason!);
|
||||||
|
if (sig.detail) console.warn('[validateModelFile]', sig.detail);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let blob: Blob, outName = fileName, outSize = buffer.byteLength;
|
let blob: Blob, outName = fileName, outSize = buffer.byteLength;
|
||||||
if (ext === 'glb') {
|
if (ext === 'glb') {
|
||||||
blob = new Blob([buffer], { type: 'model/gltf-binary' });
|
blob = new Blob([buffer], { type: 'model/gltf-binary' });
|
||||||
|
|||||||
Reference in New Issue
Block a user