File tree 1 file changed +5
-5
lines changed
libs/soba/materials/src/lib
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,11 @@ export class ManagePortalScene {
100
100
101
101
afterNextRender ( ( ) => {
102
102
portalScene ( ) . matrixAutoUpdate = false ;
103
+ } ) ;
103
104
104
- // we start the before render in afterNextRender because we need the priority input to be resolved
105
- injectBeforeRender (
105
+ effect ( ( onCleanup ) => {
106
+ // we start the before render in effect because we need the priority input to be resolved
107
+ const sub = injectBeforeRender (
106
108
( { gl, camera } ) => {
107
109
const material = this . material ( ) ;
108
110
@@ -150,6 +152,7 @@ export class ManagePortalScene {
150
152
} ,
151
153
{ injector, priority : this . priority ( ) } ,
152
154
) ;
155
+ onCleanup ( ( ) => sub ( ) ) ;
153
156
} ) ;
154
157
}
155
158
}
@@ -304,9 +307,6 @@ export class NgtsMeshPortalMaterial {
304
307
setEvents ( { enabled : ! events } ) ;
305
308
} ) ;
306
309
307
- // React.useEffect(() => {
308
- // if (events !== undefined) setEvents({ enabled: !events })
309
- // }, [events])
310
310
effect ( ( ) => {
311
311
const [ material , parent ] = [ this . materialRef ( ) . nativeElement , this . parent ( ) ] ;
312
312
if ( ! parent ) return ;
You can’t perform that action at this time.
0 commit comments