Merge pull request #111 from lijie1129/refactor/resync

Improve the judgment condition of WS connection status in resync
This commit is contained in:
Kevin Jahns 2022-06-26 21:59:11 +02:00 committed by GitHub
commit bfb9d30eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,7 +238,7 @@ export class WebsocketProvider extends Observable {
this._resyncInterval = 0
if (resyncInterval > 0) {
this._resyncInterval = /** @type {any} */ (setInterval(() => {
if (this.ws) {
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
// resend sync step 1
const encoder = encoding.createEncoder()
encoding.writeVarUint(encoder, messageSync)