Skip to content

Commit 2e61e9f

Browse files
committed
synced field works as in y-websocket
1 parent fc6f466 commit 2e61e9f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

js-pkg/client/src/provider.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ async function getClientToken(authEndpoint: AuthEndpoint, roomname: string): Pro
107107
export class YSweetProvider {
108108
private websocket: WebSocket | null = null
109109
public clientToken: ClientToken | null = null
110-
private initialSync: boolean = false
111-
private synced: boolean = false
110+
public synced: boolean = false
112111
private status: YSweetStatus = { status: STATUS_DISCONNECTED }
113112
public awareness: awarenessProtocol.Awareness
114113
private WebSocketPolyfill: WebSocketPolyfillType
@@ -411,8 +410,8 @@ export class YSweetProvider {
411410
}
412411

413412
private setSynced(state: boolean) {
414-
if (this.initialSync !== state) {
415-
this.initialSync = state
413+
if (this.synced !== state) {
414+
this.synced = state
416415
this.emit('sync', state)
417416
}
418417
}

0 commit comments

Comments
 (0)