Skip to content

Commit c9da932

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
fix(soba): call patch in try catch
1 parent 2353b4a commit c9da932

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

libs/soba/staging/src/spot-light/volumetric-mesh.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,27 @@ export class NgtsVolumetricMesh {
6666
);
6767

6868
constructor() {
69-
this.spotLightInput.patch({
70-
opacity: 1,
71-
color: 'white',
72-
distance: 5,
73-
angle: 0.15,
74-
attenuation: 5,
75-
anglePower: 5,
76-
});
69+
try {
70+
this.spotLightInput.patch({
71+
opacity: 1,
72+
color: 'white',
73+
distance: 5,
74+
angle: 0.15,
75+
attenuation: 5,
76+
anglePower: 5,
77+
});
78+
} catch {
79+
queueMicrotask(() => {
80+
this.spotLightInput.patch({
81+
opacity: 1,
82+
color: 'white',
83+
distance: 5,
84+
angle: 0.15,
85+
attenuation: 5,
86+
anglePower: 5,
87+
});
88+
});
89+
}
7790
injectBeforeRender(() => {
7891
const mesh = this.mesh.nativeElement;
7992
if (!mesh) return;

0 commit comments

Comments
 (0)