File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ export const EngineStream = (props: {
41
41
const settings = useSettings ( )
42
42
const { state : modelingMachineState , send : modelingMachineActorSend } =
43
43
useModelingContext ( )
44
- const commandBarState = useCommandBarState ( )
45
44
const { file } = useRouteLoaderData ( PATHS . FILE ) as IndexLoaderData
46
45
const last = useRef < number > ( Date . now ( ) )
47
46
Original file line number Diff line number Diff line change @@ -331,10 +331,10 @@ class EngineConnection extends EventTarget {
331
331
private engineCommandManager : EngineCommandManager
332
332
333
333
private pingPongSpan : { ping ?: number ; pong ?: number }
334
- private pingIntervalId : ReturnType < typeof setInterval > | null = null
334
+ private pingIntervalId : ReturnType < typeof setInterval > | undefined = undefined
335
335
isUsingConnectionLite : boolean = false
336
336
337
- timeoutToForceConnectId : ReturnType < typeof setTimeout > | null = null
337
+ timeoutToForceConnectId : ReturnType < typeof setTimeout > | undefined = undefined
338
338
339
339
constructor ( {
340
340
engineCommandManager,
@@ -405,7 +405,7 @@ class EngineConnection extends EventTarget {
405
405
this . tearDown = ( ) => { }
406
406
this . websocket . addEventListener ( 'open' , this . onWebSocketOpen )
407
407
408
- this . onWebSocketMessage = ( event : MessageEvent ) => {
408
+ this . websocket ?. addEventListener ( 'message' , ( ( event : MessageEvent ) => {
409
409
const message : Models [ 'WebSocketResponse_type' ] = JSON . parse ( event . data )
410
410
if ( ! ( 'resp' in message ) ) return
411
411
@@ -1244,7 +1244,7 @@ class EngineConnection extends EventTarget {
1244
1244
)
1245
1245
}
1246
1246
disconnectAll ( ) {
1247
- if ( this . websocket ?. readyState < 3 ) {
1247
+ if ( this . websocket && this . websocket ?. readyState < 3 ) {
1248
1248
this . websocket ?. close ( )
1249
1249
}
1250
1250
if ( this . unreliableDataChannel ?. readyState === 'open' ) {
You can’t perform that action at this time.
0 commit comments