@webspatial/react-sdk 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default/index.js +7 -7
- package/dist/default/index.js.map +1 -1
- package/dist/web/index.js +7 -7
- package/dist/web/index.js.map +1 -1
- package/package.json +2 -2
package/dist/default/index.js
CHANGED
|
@@ -3413,7 +3413,7 @@ function ModelBase(inProps, ref) {
|
|
|
3413
3413
|
);
|
|
3414
3414
|
const isWebEnv = !getSession();
|
|
3415
3415
|
if (isWebEnv) {
|
|
3416
|
-
const loadFailed =
|
|
3416
|
+
const [loadFailed, setLoadFailed] = useState6(false);
|
|
3417
3417
|
useEffect16(() => {
|
|
3418
3418
|
if (gltfSourceURL == "") {
|
|
3419
3419
|
console.warn("Unable to display model, no gltf/glb source provided");
|
|
@@ -3422,7 +3422,7 @@ function ModelBase(inProps, ref) {
|
|
|
3422
3422
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3423
3423
|
});
|
|
3424
3424
|
}
|
|
3425
|
-
|
|
3425
|
+
setLoadFailed(true);
|
|
3426
3426
|
}
|
|
3427
3427
|
}, []);
|
|
3428
3428
|
const myModelViewer = useRef12(null);
|
|
@@ -3445,7 +3445,7 @@ function ModelBase(inProps, ref) {
|
|
|
3445
3445
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3446
3446
|
});
|
|
3447
3447
|
}
|
|
3448
|
-
|
|
3448
|
+
setLoadFailed(true);
|
|
3449
3449
|
}
|
|
3450
3450
|
}, 500);
|
|
3451
3451
|
}, []);
|
|
@@ -3460,7 +3460,7 @@ function ModelBase(inProps, ref) {
|
|
|
3460
3460
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3461
3461
|
});
|
|
3462
3462
|
}
|
|
3463
|
-
|
|
3463
|
+
setLoadFailed(true);
|
|
3464
3464
|
}
|
|
3465
3465
|
});
|
|
3466
3466
|
myModelViewer.current.addEventListener("load", (event) => {
|
|
@@ -3469,7 +3469,7 @@ function ModelBase(inProps, ref) {
|
|
|
3469
3469
|
target: { ready: true, currentSrc: gltfSourceURL }
|
|
3470
3470
|
});
|
|
3471
3471
|
}
|
|
3472
|
-
|
|
3472
|
+
setLoadFailed(false);
|
|
3473
3473
|
});
|
|
3474
3474
|
myModelViewer.current.addEventListener("pointerdown", (event) => {
|
|
3475
3475
|
isDragging.current = true;
|
|
@@ -3533,7 +3533,7 @@ function ModelBase(inProps, ref) {
|
|
|
3533
3533
|
{
|
|
3534
3534
|
ref: myModelViewer,
|
|
3535
3535
|
style: {
|
|
3536
|
-
display: loadFailed
|
|
3536
|
+
display: loadFailed ? "none" : "",
|
|
3537
3537
|
width: "100%",
|
|
3538
3538
|
height: "100%"
|
|
3539
3539
|
},
|
|
@@ -3543,7 +3543,7 @@ function ModelBase(inProps, ref) {
|
|
|
3543
3543
|
poster: props2.poster
|
|
3544
3544
|
}
|
|
3545
3545
|
),
|
|
3546
|
-
loadFailed
|
|
3546
|
+
loadFailed ? /* @__PURE__ */ jsx16(Fragment5, { children: placeHolder }) : /* @__PURE__ */ jsx16(Fragment5, { children: " " })
|
|
3547
3547
|
] }) : /* @__PURE__ */ jsx16(Fragment5, { children: props2.poster ? /* @__PURE__ */ jsx16(
|
|
3548
3548
|
"img",
|
|
3549
3549
|
{
|