Skip to content

Commit b20e1bc

Browse files
committed
fix: typing
1 parent 0200431 commit b20e1bc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/y-socket-io/client.js

-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ export class SocketIOProvider extends Observable {
185185

186186
this.initSystemListeners()
187187

188-
189188
if (autoConnect) this.connect()
190189
}
191190

src/y-socket-io/y-socket-io.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { createSubscriber } from '../subscriber.js'
2525
*
2626
* @typedef {{
2727
* ydoc: Y.Doc;
28-
* awareness: AwarenessProtocol.Awareness;
28+
* awareness: AwarenessProtocol.Awareness | null;
2929
* redisLastId: string;
3030
* storeReferences: any[] | null;
3131
* }} RedisDoc
@@ -295,7 +295,7 @@ export class YSocketIO {
295295
).catch(console.error)
296296
}
297297
)
298-
if (this.configuration.enableAwareness && doc.awareness.states.size > 0) {
298+
if (this.configuration.enableAwareness && doc.awareness && doc.awareness.states.size > 0) {
299299
socket.emit(
300300
'awareness-update',
301301
AwarenessProtocol.encodeAwarenessUpdate(

0 commit comments

Comments
 (0)